Flash CS3 - Flash CS4

Free tutorials and scripts for all.
Actionscript 3.0

sound on mouse roll_over

This is a discussion on sound on mouse roll_over within the Actionscript 3.0 newbies forums, part of the Flash CS3 eng category; hi... i've been experimenting with some buttons in AS3 and sounds... actually the buttons are movie clips and i'...


Go Back   Forum Flash CS3 Flash CS4 > English Forums > Flash CS3 eng > Actionscript 3.0 newbies

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 25-08-08, 17:20
Junior Member
 
Join Date: Aug 2008
Posts: 13
Rep Power: 0
dpcdpc11 is on a distinguished road
sound on mouse roll_over

hi... i've been experimenting with some buttons in AS3 and sounds... actually the buttons are movie clips and i'm trying to attach a sound to the ROLL_OVER action...
i used this code:

Code:
var buttonSound:Sound = new Sound();
var buttonSoundControl:SoundChannel = new SoundChannel();

buttonSound.load(new URLRequest("buttonsound.mp3"));

button_mc.addEventListener(MouseEvent.ROLL_OVER, RollOverListener);

function RollOverListener(e:MouseEvent):void
{
    e.currentTarget.gotoAndStop(2)
    e.currentTarget.buttonMode = true;
    buttonSoundControl = buttonSound.play();
    e.currentTarget.addEventListener(MouseEvent.CLICK, ClickListener);
}
so this code works.. but it loads the sound externally... and after a few minutes of browsing through the website the roll_over sound becomes laggy... i'm guessing it's because it loads over and over in the memory when hovering the buttons.. btw here is the website so you can try it for yourself: my testing site

my idea is to attach the sound to the swf file... i know that in AS2 there was a function attachSound() but this one is missing in AS3 and has now equivalent...
so if someone could help me on this one i would be really greateful!!

thanks in advanced!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #2 (permalink)  
Old 25-08-08, 18:11
Administrator
 
Join Date: Jul 2007
Location: Cesena
Posts: 4,486
Rep Power: 6
Flep is on a distinguished road
Re: sound on mouse roll_over

Hi,
if you mean the menu buttons bottom page, they seem to work fine.

Otherwise, read this tut:
Library Sounds with Flash CS3

Also, try MOUSE_OVER instead of ROLL_OVER.
__________________

 


I recommend: Essential Actionscript 3.0

- Non rispondo ai messaggi privati con domande tecniche. Apri una discussione sul forum !
- I do not reply technicians pvt messages. Open a thread !
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #3 (permalink)  
Old 26-08-08, 15:03
Junior Member
 
Join Date: Aug 2008
Posts: 13
Rep Power: 0
dpcdpc11 is on a distinguished road
Re: sound on mouse roll_over

thanks for the tip man... i know this is the easy way to embed content into flash, using linkage... but this method works only using the flash authoring tool... is there a method which can be used in Flex??
and could you explain why MOUSE_OVER would work better than ROLL_OVER??
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #4 (permalink)  
Old 26-08-08, 16:40
Administrator
 
Join Date: Jul 2007
Location: Cesena
Posts: 4,486
Rep Power: 6
Flep is on a distinguished road
Re: sound on mouse roll_over

Difference between MouseEvent.ROLL_OVER and MouseEvent.MOUSE_OVER in AS3 | zedia flash blog
__________________

 


I recommend: Essential Actionscript 3.0

- Non rispondo ai messaggi privati con domande tecniche. Apri una discussione sul forum !
- I do not reply technicians pvt messages. Open a thread !
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads

Thread Thread Starter Forum Replies Last Post
Flash CS3 video sound out totonino Actionscript 3.0 base 1 30-10-08 22:11
Actionscript 3 Streaming sound with AS3 and PHP g82 advanced Actionscript 3.0 1 15-10-08 04:43
La classe Sound - fenomenale Flep Articoli e tutorials 11 21-09-08 21:46
loop sound... Fireantology Actionscript 3.0 base 0 07-02-08 10:33


All times are GMT. The time now is 21:36.


Powered by vBulletin versione 3.7.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC4
Forum SiteMap


FlepStudio
by Filippo Lughi
P.IVA 03605860406