Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Actionscript setproperity

Status
Not open for further replies.

jefargrafx

Instructor
May 24, 2001
273
US
why doesn't this work

onClipEvent (enterFrame) {
setProperty (_root.popoutMC, _x, _x-5);

}

onClipEvent (enterframe) {

getProperty ( popoutMC, _X )

if (this, _x == 0) {

setProperty (this, _x, 5);

}


}



If popoutMC = 0 set popoutMC _X to 5??

let me know what you think
jef
 
onClipEvent (enterframe) {

getProperty ( popoutMC, _X )
Why capital "_X"
if (this, _x == 0) {
Don't think you can write an if statement this way! Assign mymc:_x to a variable, and then check the variable in the if statement.
setProperty (this, _x, 5);

}
mywink.gif
ldnewbie
Hope that this
was helpful!
 
try:

onClipEvent (enterFrame) {
if (this._x>5) {
this._x = this._x-5;
} else {
this._x = 5;
}
}

.....on your movie-clip.

Most of the problem was down to you using commas instaed of periods in the 'this._x' statement.

dave
dave@pinkzeppelin.com

^^^^^^^^^^^^^^^^^^^^^​
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top