How to code different scenes in package function
package actions {
import flash.events.MouseEvent;
import flash.display.MovieClip;
import flash.text.TextField;
import flash.events.Event;
import flash.text.*;
import flash.net.*;
public class submit extends MovieClip {
public function submit():void {
}
}
Somehow it comes to a point I need to learn how to use package vs previously I put all the codes into .fla..
So I'm learning this, this is the basic package, when in the main.fla I have document Class linked to 'action.submit'. And I have a folder called 'action' and inside is this 'submit.as' that has the code above in it.
To my understand whatever within
public function submit():void {
}
will be loaded first? But my question is what happend if I have more than 1 scene, like for example scene 1 I have 'bttn1', scene 2 I have 'bttn2'. If I do it like this
public class submit extends MovieClip {
public function submit():void {
bttn1.buttonMode = true;
bttn1.addEventListener(MouseEvent.MOUSE_DOWN, gotoScene2);
bttn2.buttonMode = true;
bttn2.addEventListener(MouseEvent.MOUSE_DOWN, checkLogin);
}
}
will both buttons executed when user press them?
Second question is if I want on scene 2, to run a function whenever scene 2 is loaded, how do I do that in package?
Thank you
