PDA

View Full Version : Dynamically Assigning MC Positions



mecha
July 25th, 2005, 07:27 AM
Hi All,

I have a navigation section built in Flash and am trying to position headers dynamically, based on variables passed from each page.

For example, the HTML on the HOME page, will have an swf with a variable like :
nav.swf?dynHEAD=home

and NEWS will have a variable like :
nav.swf?dynHEAD=news

then in flash, I guess something like this should work - but doesnt!

dynHEAD._x = 27;
dynHEAD._y = 211;

I know Im doing something wrong, but cant figure it out. Any help?

Thanks,
mecha

Seb Hughes
July 25th, 2005, 07:51 AM
I dont fully understand but

On your Mc place this code.



onClipEvent (enterframe)
this._x = 11;
this._y = 22;


Obviusly you can change the numbers. Is this what you are looking for?

mecha
July 25th, 2005, 08:03 AM
Hi CS2 Seb,

Not really! Using your method whichever Mc I apply the code to will move, but I only want specific Mc's to move according to the variable in the SWF's URL eg. "nav.swf?dynHEAD=news" will move a Mc called "news" to the desired x & y values.

Therefore something like this....

onClipEvent (enterFrame) {
dynHEAD._x = 27;
dynHEAD._y = 211;
}

I hope this helps any possible solution, thanks for the help so far!

mecha

mecha
July 26th, 2005, 04:38 AM
Bump! :cap:

glkngs
July 26th, 2005, 05:31 AM
Hello.
The variable dynHEAD is parsed as a string in flash, therefor you can not set it's x,y. You have to tell flash the dynHEAD is actually a path to a movie clip. try this:


_root[dynHEAD]._x = 27;
_root[dynHEAD]._y = 211;

mecha
July 26th, 2005, 05:48 AM
YEP!!!!

Works like a dream! Thanks man!!!!!

mecha

glkngs
July 26th, 2005, 06:57 AM
No problemo C:-)