[flexcoders] Re: Calling javascript with navigateToURL

2007-01-10 Thread sanjaypmg
Hi,

you can try :

ExternalInterface.call(functionName, parameter);

Regards,
Sanjay sharma

--- In flexcoders@yahoogroups.com, jensen.axel [EMAIL PROTECTED] wrote:

 I'm trying to do a loop, and call a javascript function in flex for
 every loop.
 
 The loop only seems to call the javascript once the loop is done...
 and it only calls it for the last iteration of the loop.
 
 To reproduce the issue do the following:
 
 1. Create a new project in flex
 
 2. Put a button on the form, and make it's click=test1();
 
 3. Create a script block like so 
 
 mx:Script
 ![CDATA[
 private function test1():void{
   for (var i:int = 0; i  5; i++){
   var u:URLRequest = new URLRequest(javascript:alert( 
+ \'test
  + i + \'););
   
   navigateToURL(u,_self);
   trace(i);
   }
 } 
 ]]
 /mx:Script
 
 the button calls this very simple function, and theoretically you
 should get 5 alert boxes, but you don't you get 1 I'm curious 
if
 these methods can be used like this.





[flexcoders] Re: Calling javascript with navigateToURL

2007-01-10 Thread jensen.axel
That worked great, thanks 

--- In flexcoders@yahoogroups.com, jensen.axel [EMAIL PROTECTED] wrote:

 I'm trying to do a loop, and call a javascript function in flex for
 every loop.
 
 The loop only seems to call the javascript once the loop is done...
 and it only calls it for the last iteration of the loop.
 
 To reproduce the issue do the following:
 
 1. Create a new project in flex
 
 2. Put a button on the form, and make it's click=test1();
 
 3. Create a script block like so 
 
 mx:Script
 ![CDATA[
 private function test1():void{
   for (var i:int = 0; i  5; i++){
   var u:URLRequest = new URLRequest(javascript:alert( + \'test
  + i + \'););
   
   navigateToURL(u,_self);
   trace(i);
   }
 } 
 ]]
 /mx:Script
 
 the button calls this very simple function, and theoretically you
 should get 5 alert boxes, but you don't you get 1 I'm curious if
 these methods can be used like this.





Re: [flexcoders] Re: Calling javascript with navigateToURL

2007-01-10 Thread Sergey Kovalyov

http://livedocs.macromedia.com/flex/201/html/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Book_Partsfile=passingarguments_086_12.html

On 1/10/07, jensen.axel [EMAIL PROTECTED] wrote:


  That worked great, thanks

--- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, 
jensen.axel [EMAIL PROTECTED] wrote:

 I'm trying to do a loop, and call a javascript function in flex for
 every loop.

 The loop only seems to call the javascript once the loop is done...
 and it only calls it for the last iteration of the loop.

 To reproduce the issue do the following:

 1. Create a new project in flex

 2. Put a button on the form, and make it's click=test1();

 3. Create a script block like so

 mx:Script
 ![CDATA[
 private function test1():void{
 for (var i:int = 0; i  5; i++){
 var u:URLRequest = new URLRequest(javascript:alert( + \'test
  + i + \'););

 navigateToURL(u,_self);
 trace(i);
 }
 }
 ]]
 /mx:Script

 the button calls this very simple function, and theoretically you
 should get 5 alert boxes, but you don't you get 1 I'm curious if
 these methods can be used like this.