PDA

View Full Version : Javascripts not working right


Chilton
08-30-2002, 04:13 AM
Anyone seeing bizarre behavior of multiple javascripts not being executed if called from inside Flash? Here be my code, yarrrr....


getURL ("javascript:self.moveTo(0,0);");
getURL ("javascript:self.moveTo(0,0);");
getURL ("javascript:self.resizeTo((screen.width>800)?((screen.height - (screen.height*.1))/.75)-10:screen.width,(screen.height>600)?(screen.height - (screen.height*.1)):screen.height);");


The moveTo line (repeated in my code as well) does not execute at all, sometimes, and other times works flawlessly.

That last one resizes the window based on the size of your screen, and always works. Any idea why?

-Chilton

tg
08-30-2002, 04:01 PM
yes, i've noticed this problem before, but have not found out why it happens.
here's a possible work around:
you could build a javascript function in your html, include all the actions you have here, and then call the function
it's not ideal, but hopefully it will help.

GustavoGF
09-04-2002, 03:05 PM
why is the moveTo line's repeated?

Chilton
09-04-2002, 04:42 PM
Because if I don't repeat it, that line is seldom executed. The last one is always executed, for some reason. By putting that line in there twice, and don't ask me why, it actually had about a 90% chance of being executed.

I have since moved all my JS code to the html file around the window, and now just call the handler for the functions from within Flash. And now, for the first time, all is well.

-Chilton