lakor03
07-24-2009, 09:43 PM
Hi all
I'm working on a little game and would love to have a new image as background on each "new level" screen (50 total).
Right now I have the same background image on each level like this:
<mx:State name="NextLevel">
<mx:AddChild relativeTo="{myPlayArea}" position="lastChild">
<mx:Image x="0" y="0" width="242" height="484" id="levelImage" source="{imgCls}" mask="{maskCanvas}"/>
</mx:AddChild>
</mx:State>
<mx:Script>
<![CDATA[
[Embed(source="../assets/Bane1.jpg")]
[Bindable]
public var imgCls:Class;
But I would like to change the image for each level, how is that done smart? Should I create multible instances each embedding a new source? -how would that look like? or are there easier tricks?
Thanks for the help
I'm working on a little game and would love to have a new image as background on each "new level" screen (50 total).
Right now I have the same background image on each level like this:
<mx:State name="NextLevel">
<mx:AddChild relativeTo="{myPlayArea}" position="lastChild">
<mx:Image x="0" y="0" width="242" height="484" id="levelImage" source="{imgCls}" mask="{maskCanvas}"/>
</mx:AddChild>
</mx:State>
<mx:Script>
<![CDATA[
[Embed(source="../assets/Bane1.jpg")]
[Bindable]
public var imgCls:Class;
But I would like to change the image for each level, how is that done smart? Should I create multible instances each embedding a new source? -how would that look like? or are there easier tricks?
Thanks for the help