Topic: Hide objects after Looping

Hi all, there are days that im trying to fix it no solution
and because of my bad english nobody understand what i really mean
because of this i will post here the code + url example
PS. please if someone reply me with a code can please say why i have to do
like that, i Like of understand smile

this is the button code:

_root.bt1.onRelease =function (){
_root.mymovie.symb1 = 1;
_root.mymovie.symb2 = 0;
_root.mymovie.symb3 = 0;
_root.bt2.onRelease =function (){
_root.mymovie.symb1 = 0;
_root.mymovie.symb2 = 1;
_root.mymovie.symb3 = 0;
_root.bt3.onRelease =function (){
_root.mymovie.symb1 = 0;
_root.mymovie.symb2 = 0;
_root.mymovie.symb3 = 1;

this is the loop code:

//variables coming from PHP
members = 5;
type1 = "burger";
takeid1 = symb1;
pos1x = 150;
pos1y = 220;
type2 = "beer";
takeid2 = symb2;
pos2x = 300;
pos2y = 250;                    
type3 = "pizza";
takeid3 = symb3;
pos3x = 460;
pos3y = 160;
type4 = "burger";
takeid4 = symb1;
pos4x = 55;
pos4y = 320;
type5 = "beer";
takeid5 = symb2;
pos5x = 510;
pos5y = 300;
for (var i = 1; i<=members; i++) {
	ref = _root.mymovie.attachMovie(eval("type"+i), "obj"+i, _root.mymovie.getNextHighestDepth());
	ref._x = eval("pos"+i+"x");
	ref._y = eval("pos"+i+"y");

	ref._visible = eval("takeid"+i);

Im trying hide objects that was created on Loop by a variable named takeid
the php are sending the var to flash as takeid1 = symb1 and
symb1 mean all hamburgers on Movie, then when i press the BT_object1
the var symb1 will change your value to 1(true) and all others symb to 0(false)
theorically should work, but on my Movie dont work, it work only if i do inside this code
the var symb1 = 1; or symb1 = 0; and the variable are being sent to the Movie,
i Think that after that a MC was attacked they cant to be modifyed untill i reload
this action with the new var, but it for me is bad i need a way of hide this objects
without to rebuild all loop.

source file (flash 8 AS.2)

thank you To all that are trying to Help me big_smile

Re: Hide objects after Looping

After looking thru the code you posted I'm not sure what's going on and I figured it would be easier to just post the following than to try to fix what you have. Is this something like the behavior you are looking for? ->

At the moment there are only 17 dynamic clips on the stage but they are being dynamically generated from an XML file: . This file is loaded when the movie first runs. There is a simple AS class to parse it and generate a 2-D array of objects based on the XML file. Once it's loaded the class calls an init function in the root to set up the menu based on the XML data.

I think the issues you are having could be solved with a few custom movieclip properties. In the object demo code you should see a chunk that is setting up the movieclips on the stage you will see a segment like:

			var this_sound:String = "sound" + d + "_mc";
			var this_clip:MovieClip = duplicateMovieClip("button_mc", this_sound, _root.getNextHighestDepth());	
			_root[this_sound]._y = row_inc;
			_root[this_sound].init = false;
			_root[this_sound].author = this_obj['author'];
			_root[this_sound].body = this_obj['body'];
			_root[this_sound].id = "2-" + d + ".mp3";
			_root[this_sound]._select = "on";

All of these are assigning properties for their respective clips. Some of them (_y, _x) are default properties that come with Flash and are inherent to movieclips. The rest (author, body, id, _select, etc) are custom properties that we are defining. Basically we are telling each movieclip to be "smart" that is to know some certain information about itself that it can send out later. author and body come from the XML, _select is used for some logical operations a little later.

While setting up these MCs you can also assign behaviors to them on the fly:

				_root[this_sound].onRollOver = function()
					_root.display_mc.auth_txt.htmlText = "<b>Artist:</b> " +;
					_root.display_mc.bod_txt.htmlText = "<b>Song:</b> " + this.body;

Here you are telling whichever clip is rolled over to play its animations as well as set the display text on the root as HTML. You can assign behaviors this way to just about any event (mouseUp, mouseDown, onRollOut, onLoad, etc) in this manner. See the source for more details.

Anyway, there is a lot of other stuff going on in the program but none of it is too complicated. I think you should be able to hack this to make it do pretty much what you describe above. Note that to add more buttons to the stage with the same behaviors, all you have to do is add more lines to your XML file; you don't even need to have Flash open to modify it. You can download the source, including the XML class and the XML file, here: . Go nuts, tear it apart if you want, you can use it for whatever you want; post up here if you have any questions.

Others: if it's OK with you guys, I would submit this as the first entry into our code repository. I'm definitely open to any feedback / suggestions for improvement if it can go up.


Lord, give us the wisdom to utter words that are gentle and tender, for tomorrow we may have to eat them.   -Rep. Morris Udall

Re: Hide objects after Looping

Ohhhh thank you very Much, God bless you smile
im studying it now big_smile, soon i will post here the reults...

Peace big_smile...