Accessing instance variables from container
i new flash. programmer, not designer first foray actionscript.
i creating slide show player in flash. retrieves xml file containing other .swf files should played, order in should played, length of time each 1 should show, , text should displayed.
for example:
<presentation>
<globals>
<setting name="use_transitions" value="false"/>
<setting name="use_delays" value="false"/>
</globals>
<slide src="slide5.swf" text="slide 1" delay="10"/>
<slide src="slide3.swf" text="slide 2" delay="10"/>
</presentation>
i have working except loaded .swf file picking on text display.
i can set var: property on dynamic text field _root.dynamic_text , load in variable dynamic_text fine.
however, slide3.swf , slide5.swf file have default text in them should if there no text specified.
it seems variables inside loaded movie not in scope.
i load movie using:
loadmovie(slides[nindex][0], "slidemovie");
however if instance name on dynamic text field "thetext" code not work:
this.slidemovie.thetext.text = dynamic_text;
how dereference dynamic text field?
thanks help.
i creating slide show player in flash. retrieves xml file containing other .swf files should played, order in should played, length of time each 1 should show, , text should displayed.
for example:
<presentation>
<globals>
<setting name="use_transitions" value="false"/>
<setting name="use_delays" value="false"/>
</globals>
<slide src="slide5.swf" text="slide 1" delay="10"/>
<slide src="slide3.swf" text="slide 2" delay="10"/>
</presentation>
i have working except loaded .swf file picking on text display.
i can set var: property on dynamic text field _root.dynamic_text , load in variable dynamic_text fine.
however, slide3.swf , slide5.swf file have default text in them should if there no text specified.
it seems variables inside loaded movie not in scope.
i load movie using:
loadmovie(slides[nindex][0], "slidemovie");
however if instance name on dynamic text field "thetext" code not work:
this.slidemovie.thetext.text = dynamic_text;
how dereference dynamic text field?
thanks help.
i have workaround.
set var "dynamic_text"
in actionscript embedded clip put:
var dynamic_text = "default text";
if (_root.dynamic_text)
{
this.dynamic_text = _root.dynamic_text;
}
this not ideal solution. else?
set var "dynamic_text"
in actionscript embedded clip put:
var dynamic_text = "default text";
if (_root.dynamic_text)
{
this.dynamic_text = _root.dynamic_text;
}
this not ideal solution. else?
More discussions in ActionScript 1 and 2
adobe
Comments
Post a Comment