dcsimg
A Flash Developer Resource Site

Results 1 to 12 of 12

Thread: onClipEvent in actionsciprt

  1. #1
    Senior Member
    Join Date
    Dec 2005
    Posts
    426

    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

  2. #2
    Senior Member
    Join Date
    Mar 2005
    Location
    MI
    Posts
    279
    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.

  3. #3
    Knows where you live
    Join Date
    Oct 2004
    Posts
    944
    _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

  4. #4
    Senior Member
    Join Date
    Dec 2005
    Posts
    426
    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?

  5. #5
    Senior Member
    Join Date
    Nov 2004
    Posts
    928
    inside the flame mc

    this.onEnterFrame = function() {
    //whatever;
    }

  6. #6
    Senior Member
    Join Date
    Dec 2005
    Posts
    426
    and how to i make the object move?
    would it be
    this._x += speed; it did not work before

  7. #7
    Senior Member
    Join Date
    Nov 2004
    Posts
    928
    this.onEnterFrame = function() {
    this._x+=5;
    }
    or
    speed = 5;
    this.onEnterFrame = function() {
    this._x+=speed;
    }

  8. #8
    Senior Member
    Join Date
    Dec 2005
    Posts
    426
    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;
    };

  9. #9
    Senior Member
    Join Date
    Nov 2004
    Posts
    928
    what are you trying to achieve? explain more fully and then i may be in a position to suggest a solution

  10. #10
    Senior Member
    Join Date
    Dec 2005
    Posts
    426
    make it so that the flame is created at the player and that it moves down

  11. #11
    Senior Member
    Join Date
    Nov 2004
    Posts
    928
    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

  12. #12
    Senior Member
    Join Date
    Dec 2005
    Posts
    426
    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
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center