header
ask question
Click here to ask Question Now Its free No registration required. Flash, Flex, Flash Media Server, ActionScript,Adobe Air. Most questions receive a response in an hour.
lgreenwald
Points:10
Posts:0

1/30/2011 10:42:52 AM

Title: Add instance name to onClipEvent


Hi there!

I'm using the following bit of AS2 on a couple of mc's of my project so I would like to use the specific instance name in this:

onClipEvent(enterFrame){
this._x = this._x + (_root.intSlideToX - this._x ) /5;
this._y = this._y + (_root.intSlideToY - this._y ) /5;
}

It needs to call printMC, specifically.

Here's what's on the button:
on (release) {
_root.intSlideToX = 642.5
_root.intSlideToY = -187.3
}

printMC is NOT on the root level but the button is.

Any help would be wildly appreciated!



1
Wilbur
Points: 510
Posts:0
1/31/2011 4:10:43 AM



You can write the following onClipEvent code in root and apply on any MC, button code does not require any change


printMC.onClipEvent(enterFrame){
printMC._x = printMC._x + (_root.intSlideToX - printMC._x ) /5;
printMC._y = printMC._y + (_root.intSlideToY - printMC._y ) /5;
} 


Post your Reply
Name  

Email

Type your Reply or Answer

Are you human? What is 8+0 



Members Login

Email  
Password
Forgot Password





This website focus on: Flash | Flex | FMS | RED5 | WOWZA | Flash Media Server | Adobe AIR | ActionScript,Flash Solutions | Flash Question | Flash Answers | Flash Developers | Flash Problem, Flash Help, Flash bugs, Flash workaround | Flash Blog | Flex Question Answers | Flash Forum | Flex Development | Actionscript development | Flash development | Adobe AIR development
Copyright © 2008 AskMeFlash.com. All rights reserved. Privacy Policy | Terms & Conditions