Skip to main content
Participant
April 16, 2007
Question

setProperty in MX 2004

  • April 16, 2007
  • 2 replies
  • 328 views
I want to control the location of a movieclip using setProperty and using xy coordinates but my syntax is screwed up, I keep getting a message saying expect ')' or ',' but I don't know where it goes. Is this correct: setProperty (this.movieinstance._x = 316) ? This is a button script used to reset the location of a movie clip when the restarting the parent movie. If you can help, thanks.
This topic has been closed for replies.

2 replies

Inspiring
April 16, 2007
mauimomsc,

> I want to control the location of a movieclip using
> setProperty and using xy coordinates but my syntax
> is screwed up,

setProperty() was introduced in Flash 4. With Flash CS3 (aka 9) just
around the corner, I recommend you use a more recent approach -- unless
you're specifically intending to publish Flash 4 content.

> I keep getting a message saying expect ')' or ',' but
> I don't know where it goes. Is this correct:
> setProperty (this.movieinstance._x = 316) ?

Aha! That's an example trying to combine the old and new ways. ;) The
easiest way to set the MovieClip._x property of your movie clip is simple to
reference its instance name, then the property, then set its value ...

movieinstance._x = 316;

... using any sort of object reference you want, such as "this" or _root,
etc. as necessary.

If you look up the setProperty() entry in the ActionScript Language
Reference, you'll see in the code samples that the older syntax is very
different.

setProperty(movieinstance, _x, 316);


David Stiller
Adobe Community Expert
Dev blog, http://www.quip.net/blog/
"Luck is the residue of good design."


mauimomscAuthor
Participant
April 16, 2007
Does this sequence work for Flash MX 2004?
kglad
Community Expert
Community Expert
April 16, 2007
nope, it sure isn't.

you should use:

mauimomscAuthor
Participant
April 16, 2007
I am using Flash MX 2004....does this sequence work for this version?