[flexcoders] SWFLoader query string?

2007-03-15 Thread Chad Callahan
When programming in AS2 for Flash, I was always able to have an AS2 swf
load into it another AS2 swf and pass that swf variables using query
string as such:

swfToLoad.swf?var1=1var2=2

When the swfToLoad ran, it automatically had the var1 and var2 variables
declared and assigned the same values that were added onto the query
string.

I now need to use the same idea but have Flex load an AS2 swf and pass
the swf a query string. 

mx:SWFLoader source=swfToLoad.swf?var1=1var2=2/

However, when the swfToLoad (which is a flash 8 as2 swf) loads, those
var1 and var2 variables trace out as undefined.

I've also tried using the SWFLoader's load command rather than source,
but the same problem.  I've also tried using an mx:Image instead of
SWFLoader, same problem.  Is there a way to pass variables into the swf
OTHER than using a local connection?  

(I say other than using a local connection because that is the whole
purpose of me doing this. I'm trying to pass a random connection id from
Flex into the Flash swf so they use the same (random) connection id)

 

 

 

CHAD CALLAHAN
PROGRAMMER

T8DESIGN.COM | P 319.266.7574 - x195 | 877.T8IDEAS | F 888.290.4675


This e-mail, including attachments, is covered by the Electronic
Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential, and
may be legally privileged. If you are not the intended recipient, you
are hereby notified that any retention, dissemination, distribution, or
copying of this communication is strictly prohibited. Please reply to
the sender that you have received the message in error, and then please
delete it. Thank you.



 

attachment: image001.jpg


RE: [flexcoders] SWFLoader query string?

2007-03-15 Thread {reduxDJ}
Chad:

 

I don't know why that traces out undefined for you, this is what I am doing
in my mxml to pass variables in a query string and it works.

 

Thanks,
Patrick

 

 

private function createTextEffects(s:String):void{

var swf:SWFLoader = new SWFLoader();

panelMain.addChild(swf);

swf.load(components/someswf.swf?somevar=+s);

}



 

  _  

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Chad Callahan
Sent: Thursday, March 15, 2007 11:19 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] SWFLoader query string?

 

When programming in AS2 for Flash, I was always able to have an AS2 swf load
into it another AS2 swf and pass that swf variables using query string as
such:

swfToLoad.swf?var1=1var2=2

When the swfToLoad ran, it automatically had the var1 and var2 variables
declared and assigned the same values that were added onto the query string.

I now need to use the same idea but have Flex load an AS2 swf and pass the
swf a query string. 

mx:SWFLoader source=swfToLoad.swf?var1=1var2=2/

However, when the swfToLoad (which is a flash 8 as2 swf) loads, those var1
and var2 variables trace out as undefined.

I've also tried using the SWFLoader's load command rather than source, but
the same problem.  I've also tried using an mx:Image instead of SWFLoader,
same problem.  Is there a way to pass variables into the swf OTHER than
using a local connection?  

(I say other than using a local connection because that is the whole purpose
of me doing this. I'm trying to pass a random connection id from Flex into
the Flash swf so they use the same (random) connection id)

 

 




CHAD CALLAHAN
PROGRAMMER


T8DESIGN.COM | P 319.266.7574 - x195 | 877.T8IDEAS | F 888.290.4675

 


This e-mail, including attachments, is covered by the Electronic
Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential, and may be
legally privileged. If you are not the intended recipient, you are hereby
notified that any retention, dissemination, distribution, or copying of this
communication is strictly prohibited. Please reply to the sender that you
have received the message in error, and then please delete it. Thank you.

  _  

 

 

attachment: image001.jpg


RE: [flexcoders] SWFLoader query string?

2007-03-15 Thread Tracy Spratt
You have to access the passed in parameters using the
Application.parameters object / associative array.  It the swf does not
contain an application, then I am clueless.

 

You can also get a live reference to the content(application) and access
public members that way.  There are data type issues and timing issues
to be aware of though.  I'll post some example code if you'd like.

 

Tracy

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of {reduxDJ}
Sent: Thursday, March 15, 2007 4:56 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] SWFLoader query string?

 

Chad:

 

I don't know why that traces out undefined for you, this is what I am
doing in my mxml to pass variables in a query string and it works.

 

Thanks,
Patrick

 

 

private function createTextEffects(s:String):void{

var swf:SWFLoader = new SWFLoader();

panelMain.addChild(swf);

swf.load(components/someswf.swf?somevar=+s);

}



 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Chad Callahan
Sent: Thursday, March 15, 2007 11:19 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] SWFLoader query string?

 

When programming in AS2 for Flash, I was always able to have an AS2 swf
load into it another AS2 swf and pass that swf variables using query
string as such:

swfToLoad.swf?var1=1var2=2

When the swfToLoad ran, it automatically had the var1 and var2 variables
declared and assigned the same values that were added onto the query
string.

I now need to use the same idea but have Flex load an AS2 swf and pass
the swf a query string. 

mx:SWFLoader source=swfToLoad.swf?var1=1var2=2/

However, when the swfToLoad (which is a flash 8 as2 swf) loads, those
var1 and var2 variables trace out as undefined.

I've also tried using the SWFLoader's load command rather than source,
but the same problem.  I've also tried using an mx:Image instead of
SWFLoader, same problem.  Is there a way to pass variables into the swf
OTHER than using a local connection?  

(I say other than using a local connection because that is the whole
purpose of me doing this. I'm trying to pass a random connection id from
Flex into the Flash swf so they use the same (random) connection id)

 

 

 

CHAD CALLAHAN
PROGRAMMER

T8DESIGN.COM | P 319.266.7574 - x195 | 877.T8IDEAS | F 888.290.4675

 


This e-mail, including attachments, is covered by the Electronic
Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential, and
may be legally privileged. If you are not the intended recipient, you
are hereby notified that any retention, dissemination, distribution, or
copying of this communication is strictly prohibited. Please reply to
the sender that you have received the message in error, and then please
delete it. Thank you.



 

 

attachment: image001.jpg


Re: [flexcoders] SWFLoader query string?

2007-03-15 Thread Bjorn Schultheiss

Hey Chad,

I've been working on exactly this problem most of the week.

first to pass in your unique local conn string.

[flex]
mx:SWFLoader source=whatever.swf?flashId=foobar /

[flash]
var connid = flashId;
trace('connid: '+connid);

Except this will not work if your flash resides on a different domain.
It will try load the var before allowDomain().



There are alot more issues you'll run into
http://groups.yahoo.com/group/flexcoders/message/ 
67817;_ylc=X3oDMTM3MjFlMmcyBF9TAzk3MzU5NzE0BGdycElkAzEyMjg2MTY3BGdycHNwS 
WQDMTcwNTAwNzIwNwRtc2dJZAM2Nzk4NQRzZWMDZnRyBHNsawN2dHBjBHN0aW1lAzExNzM5M 
zQ2NTMEdHBjSWQDNjc4MTc-



regards,

Bjorn



On 16/03/2007, at 10:16 AM, Tracy Spratt wrote:



You have to access the passed in parameters using the  
Application.parameters object / associative array.  It the swf does  
not contain an application, then I am clueless.




You can also get a live reference to the content(application) and  
access public members that way.  There are data type issues and  
timing issues to be aware of though.  I’ll post some example code  
if you’d like.




Tracy



From: flexcoders@yahoogroups.com  
[mailto:[EMAIL PROTECTED] On Behalf Of {reduxDJ}

Sent: Thursday, March 15, 2007 4:56 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] SWFLoader query string?



Chad:



I don’t know why that traces out undefined for you, this is what I  
am doing in my mxml to pass variables in a query string and it works.




Thanks,
Patrick





private function createTextEffects(s:String):void{

var swf:SWFLoader = new SWFLoader();

panelMain.addChild(swf);

swf.load(components/someswf.swf?somevar=+s);

}





From: flexcoders@yahoogroups.com  
[mailto:[EMAIL PROTECTED] On Behalf Of Chad Callahan

Sent: Thursday, March 15, 2007 11:19 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] SWFLoader query string?



When programming in AS2 for Flash, I was always able to have an AS2  
swf load into it another AS2 swf and pass that swf variables using  
query string as such:


swfToLoad.swf?var1=1var2=2

When the swfToLoad ran, it automatically had the var1 and var2  
variables declared and assigned the same values that were added  
onto the query string.


I now need to use the same idea but have Flex load an AS2 swf and  
pass the swf a query string.


mx:SWFLoader source=swfToLoad.swf?var1=1var2=2/

However, when the swfToLoad (which is a flash 8 as2 swf) loads,  
those var1 and var2 variables trace out as undefined.


I’ve also tried using the SWFLoader’s load command rather than  
source, but the same problem.  I’ve also tried using an mx:Image  
instead of SWFLoader, same problem.  Is there a way to pass  
variables into the swf OTHER than using a local connection?


(I say other than using a local connection because that is the  
whole purpose of me doing this. I'm trying to pass a random  
connection id from Flex into the Flash swf so they use the same  
(random) connection id)






image001.jpg

CHAD CALLAHAN
PROGRAMMER

T8DESIGN.COM | P 319.266.7574 - x195 | 877.T8IDEAS | F 888.290.4675




This e-mail, including attachments, is covered by the Electronic  
Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential,  
and may be legally privileged. If you are not the intended  
recipient, you are hereby notified that any retention,  
dissemination, distribution, or copying of this communication is  
strictly prohibited. Please reply to the sender that you have  
received the message in error, and then please delete it. Thank you.