Reputation: 1004
I am really confused about this issue ...
In the first Frame i wrote the following code:
stop();
var currentInterInfo:IntersectionInfo = null;
var currentInter:Intersection;
gotoAndPlay("Frame3");
and in the 2nd frame (labeled "Frame2") i wrote:
stop();
trace("Frame2");
and in the 3rd frame (labeled "Frame3") i wrote:
stop();
currentInter = new Intersection(.....); // notes that the constructor of the Intersection class is empty
trace("Frame3");
When I run it, i get "Frame 2" in the output although i should get "Frame 3" as a result ... and When I debug, i get "Frame 3" ... no idea whats wrong here ... I uploaded my project in the link below in case u want to check it out ...
Upvotes: 0
Views: 846
Reputation: 2238
Works for me!.
The case in this sutuation is:
When you compiling the SWF inside the flash or loading it, it is loading all of the frames.
So at this point not all of the frames are stacked, so you are beeing sent to the last one available in this case it is 2.
in the 1st frame change your code to:
import flash.utils.setTimeout;
stop();
var currentInterInfo:IntersectionInfo = null;
var currentInter:Intersection;
setTimeout ( init, 100 )
function init ()
{
gotoAndPlay("Frame3");
}
Or somehow prevent application launch before it is completely loaded.
Upvotes: 1