Copy link to clipboard
Copied
I have a flash intro to my website and I have (2) buttons one sound one skip intro. The sound works fine but the skip button will not work. Here is my code.
skipBtn.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
function mouseDownHandler(event:MouseEvent):void {
gotoAndPlay(401);
any suggestions?
Copy link to clipboard
Copied
do you see the trace output when you click your button and does that match the name of the movieclip that has 401+ frames:
skipBtn.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
function mouseDownHandler(event:MouseEvent):void {
trace(this.name);
gotoAndPlay(401);
}
Copy link to clipboard
Copied
I get these errors when I test.
Scene=Scene 1, layer=Layer 22, frame=18, Line 1 Statement must appear within on handler
Scene=Scene 1, layer=Layer 22, frame=18, Line 2 The class or interface 'MouseEvent' could not be loaded.
Copy link to clipboard
Copied
you're publishing for as2.
change your publish settings to as3, if you want to use as3 code.
Copy link to clipboard
Copied
This is for as3?
WARNING: Text field variable names are not supported in ActionScript 3.0. The variable 'text' used for an unnamed text field will not be exported.
WARNING: Actions on button or MovieClip instances are not supported in ActionScript 3.0. All scripts on object instances will be ignored.
ReferenceError: Error #1065: Variable duplicateMovieClip is not defined.
at default_fla::Symbol6_2/frame1()
ReferenceError: Error #1065: Variable duplicateMovieClip is not defined.
at default_fla::Symbol12_4/frame1()
Copy link to clipboard
Copied
you have a fla that's using some as3 and some as2. that will not work.
you must decide on as2 or as3. under no circumstance can one fla contain code from both actionscript versions.
Copy link to clipboard
Copied
I do not care if I use as2 or as3. I just need to add a ship button to my intro so users can bypass the intro. Any suggestion would be greatly appreicated.
Copy link to clipboard
Copied
remove all your as2 code and convert to as3.
in particular, no code show be attached to any object. all your code should be attached to a timeline frame.
you should probably start with a new as3 fla and step-by-step add some of the problematic fla's assets/code to the new fla. test after each step. correct each error as they occur.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now