jnmwilson
03-01-2008, 05:33 PM
Okay, here is what I am trying to do...
In my RPG, I have a map created with different tiles. Now, if the character encounters an enemy character it goes to the battle sequence.
What I want to do, is display the proper background image according to the type of tile the player was standing on (grass,water,swamp, etc...).
How do I assign that in the Tile1.prototype...... process??
In the main timeline, I have this for the root variable: _root.terrain = "";
The function would go something like this:
terrain = function(){
if(_root.terrain=="grass"){
batBack_mc = grass_mc;
}else if(_root.terrain=="swamp"){
batBack = swamp_mc;
}
}
terrain();
This is just a rough representation of the actual function...but, can anyone help out with how I would assign the "terrain" variable to a tile prototype so that I can read it into a root variable at a specific time???:confused:
In my RPG, I have a map created with different tiles. Now, if the character encounters an enemy character it goes to the battle sequence.
What I want to do, is display the proper background image according to the type of tile the player was standing on (grass,water,swamp, etc...).
How do I assign that in the Tile1.prototype...... process??
In the main timeline, I have this for the root variable: _root.terrain = "";
The function would go something like this:
terrain = function(){
if(_root.terrain=="grass"){
batBack_mc = grass_mc;
}else if(_root.terrain=="swamp"){
batBack = swamp_mc;
}
}
terrain();
This is just a rough representation of the actual function...but, can anyone help out with how I would assign the "terrain" variable to a tile prototype so that I can read it into a root variable at a specific time???:confused: