PDA

View Full Version : JavaScript wants to kill me


LegoTrip
10-15-2008, 11:33 AM
Hi guys.

Ok, this problem which is beating me up is as follows:

I have a base.swf, which loads various other swfs into it, and a frame with the name "firstlvl".

Then I have a bunch of JavaScript, which for the most part, seems to be getting along with eachother quite nicely.

However, one certain JavaScript function is misbehaving. It is:

flashMovie.GotoFrame('firstlvl');


When the function containing this info is read, it jumps to the first frame instead of the frame with the right label.

I have NO idea why, but I have a slight feeling that it MIGHT have something to do with the Preloader in the first scene. When i remove this preloader, however, it gets even more unpredictable.

Anybody know anything about this? Or ask any questions to help me ask clearer?

Thanks!

LegoTrip
10-15-2008, 11:51 AM
Ok, just to update that the JavaScript isn't sending the flashmovie to ANY frame. It basically reads like this:

function noTouch(movie, part) {
var flashMovie=getFlashMovieObject(movie);

if(part == 1) {
flashMovie.GotoFrame('firstlvl');
} else if(part == 2) {
flashMovie.GotoFrame('secondlvl02');
} else if(part == 3) {
flashMovie.GotoFrame('thirdlvl02');
}
}


But when you call the noTouch function, it always sends the base.swf back to the first frame.

HEEEYELP!!! :( :(

jasonJ
10-23-2008, 07:24 PM
How do you receive these strings in flash? Did you try tracing them in flash? Perhaps you just need to make sure these really are strings and use toString() method in flash.