PDA

View Full Version : Using Expressions to Set Properties in Flash 4


subscripter
10-09-2001, 03:15 PM
I am trying to use a script that will change the properties of several different movie clips depending on user actions.

To do this I need to use an expression to specify the target whose property I want to change, but I can't seem to get the syntax right.

I have 16 mc's nested in the main timeline which are called pic1 to pic16.

The script is in a 'scripts' mc also on the main timeline.

I have passed a variable to the 'scripts' mc defining 'pic' as the number of the 'pic' mc for example ../scripts:pic =16

I am then using the set property action below

Set Property ("../pic"&pic, X Position) = 254.4

I want flash to read this as

Set Property ("../pic16", X Position) = 254.4

When ../scripts:pic =16

But it don't work.

What an I doing wrong?

tg
10-09-2001, 03:41 PM
if i get you right, you have a bunch of mcs named "pic1" to "pic16" all on the root level???

if this is correct then try this (i hope you are doing this in flash5, cause i don't do that f4 stuff).

indeX=16;
this["pic"+indeX]._x=254.4;

subscripter
10-09-2001, 04:24 PM
Thanks for replying,

I got it fixed now.

Do many people still use Flash 4

I still have to create content in Flash 4 That is why I still use it.

Should I create it in Flash 5 and just publish it as Flash 4?

tg
10-09-2001, 04:57 PM
don't know if you can...
anybody else know???

red penguin
10-09-2001, 08:07 PM
Yes, you can in fact publish from F5 as F4...just don't use any dot notation or anything that F4 doesn't recognize.