Re: [Flashcoders] setting variable

2010-06-05 Thread tom rhodes
var myContent:MovieClip = loadEvent.currentTarget.content as MovieClip;

...

then later...

myContent.myVar = something;


On 4 June 2010 18:46, Lehr, Theodore ted_l...@federal.dell.com wrote:

 What would it's instance name be?

 my last line is:

 addChild(loadEvent.currentTarget.content);

 
 From: flashcoders-boun...@chattyfig.figleaf.com [
 flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Henrik Andersson [
 he...@henke37.cjb.net]
 Sent: Friday, June 04, 2010 12:39 PM
 To: Flash Coders List
 Subject: Re: [Flashcoders] setting variable

 Lehr, Theodore wrote:
  So I am loading a swf - How can I set a value of a variable in that swf
 from the parent?

 Same as if it was a mc that you hadn't loaded separately.
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] setting variable

2010-06-05 Thread Henrik Andersson

tom rhodes wrote:

var myContent:MovieClip = loadEvent.currentTarget.content as MovieClip;


It is never a good idea to just cast to MovieClip. Cast to the real 
class of the object. Or at least an interface that you know that it will 
implement.


Do note that there are complications regarding having multiple 
definitions of the same class and so on when loading swf files.

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] setting variable

2010-06-04 Thread Henrik Andersson

Lehr, Theodore wrote:

So I am loading a swf - How can I set a value of a variable in that swf from 
the parent?


Same as if it was a mc that you hadn't loaded separately.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] setting variable

2010-06-04 Thread Lehr, Theodore
What would it's instance name be?

my last line is:

addChild(loadEvent.currentTarget.content);


From: flashcoders-boun...@chattyfig.figleaf.com 
[flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Henrik Andersson 
[he...@henke37.cjb.net]
Sent: Friday, June 04, 2010 12:39 PM
To: Flash Coders List
Subject: Re: [Flashcoders] setting variable

Lehr, Theodore wrote:
 So I am loading a swf - How can I set a value of a variable in that swf from 
 the parent?

Same as if it was a mc that you hadn't loaded separately.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders