-
onClipEvent in actionsciprt
how do i do a onClipEvent on frame inside an object.
I wnat to move the object that the frame is in
-
i don't quite understand what you are asking if you post a file that might help
Our greatest fear is not that we are inadequate,
but that we are powerful beyond measure.
-
_root.mySomething.onClipEvent = function() {
};
Is all I can think of that may do what you want.
I suppose a class may be able to do something like that as well.
The greatest pleasure in life is doing what people say you cannot do.
- Walter Bagehot
The height of cleverness is to be able to conceal it.
- Francois de La Rochefoucauld
-
how i have it set up like this.
i attach the movie clip flame
then i need to program it on the frame inside of the movieclip frame.
so how do i move the flame with the frame inside of it?
-
inside the flame mc
this.onEnterFrame = function() {
//whatever;
}
-
and how to i make the object move?
would it be
this._x += speed; it did not work before
-
this.onEnterFrame = function() {
this._x+=5;
}
or
speed = 5;
this.onEnterFrame = function() {
this._x+=speed;
}
-
it does not work.
i have an object labeld flame i double click on flame and it opens it to edit it. now i click on the first frame of flame and in the actions panel i type:
Code:
this.load=function(){
this._x = _root.hero._x-10;
this._y = _root.hero._y-10;
};
-
what are you trying to achieve? explain more fully and then i may be in a position to suggest a solution
-
make it so that the flame is created at the player and that it moves down
-
depends on how you want to initiate the flame so as an example -
_root.hero.onRelease = function() {
_root.flame._x=_root.hero._x-10;
_root.flame._y=_root.hero._y-10;
_root.flame.onEnterFrame = function() {
this._x+=5;
}
}
place this code on a seperate layer on the main timeline. this assumes that both hero and flame are on the stage. this is a cheesey way to do it - but i give it as an example so you can see an approach - also i dont know how what or why you are doing it
-
i will have multiple instances of flame but i could use for loops
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|