function doesnt work without an alert()

  • Follow


Hello

I have this code in actionscript that calls javascript:

actionscript:

zoom_in = function () {
     var tw1:Tween = new Tween(mc_1, "_width", Regular.easeOut, 
mc_1._width, 0, 1, false); //OK
     var tw2:Tween = new Tween(mc_1, "_height", Regular.easeOut, 
mc_1._height, 0, 1, false); //OK
     ExternalInterface.call("zoom");
}

javascript:

function zoom()
{
     top.resizeTo(1024, 768);
     self.moveTo(0,0);
}

Everything works perfectly on Firefox 1.5 but not on IE 6+

in IE the "zoom" function doesn't work, but if I add an alert it DOES work:

function zoom()
{
     alert('this works');
     top.resizeTo(1024, 768);
     self.moveTo(0,0);
}

Does anyone knows what can be wrong with the code? it doesn't make any 
sense, any help will be appreciated.

thanks and regards.
0
Reply Hugo 4/25/2006 8:56:40 AM

Hugo Flores wrote:
> Hello
>
> I have this code in actionscript that calls javascript:
>
> actionscript:
>
> zoom_in = function () {
>      var tw1:Tween = new Tween(mc_1, "_width", Regular.easeOut,
> mc_1._width, 0, 1, false); //OK
>      var tw2:Tween = new Tween(mc_1, "_height", Regular.easeOut,
> mc_1._height, 0, 1, false); //OK
>      ExternalInterface.call("zoom");
> }
>
> javascript:
>
> function zoom()
> {
>      top.resizeTo(1024, 768);
>      self.moveTo(0,0);
> }
>
> Everything works perfectly on Firefox 1.5 but not on IE 6+
>
> in IE the "zoom" function doesn't work, but if I add an alert it DOES work:
>
> function zoom()
> {
>      alert('this works');
>      top.resizeTo(1024, 768);
>      self.moveTo(0,0);
> }
>
> Does anyone knows what can be wrong with the code? it doesn't make any
> sense, any help will be appreciated.

See explanation and demo sample at:
<http://groups.google.com/group/comp.lang.javascript/msg/e02fd02952dd0d24>

Browser graphics context is not updated until you exit from the current
execution thread. This is the same for all UA's, so I'm not sure what
do you call "works perfectly in Firefox".

0
Reply VK 4/25/2006 10:14:33 AM


1 Replies
318 Views

(page loaded in 0.034 seconds)

Similiar Articles:













7/25/2012 6:13:37 PM


Reply: