A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: onClipEvent(load) Question.

  1. #1
    But it still fills prams ivorsmallun's Avatar
    Join Date
    Jul 2001
    Location
    Far Far Away
    Posts
    400

    onClipEvent(load) Question.

    Hi Flash people,

    What is the onClipEvent(load) for.
    My understanding of the event is that when then movie clip enters the stage it runs through the event once using the infomation stored.

    Why then when duplacate a mc and put a onClipEvent(load) then a onClipEvent(enterframe) it seems to keep running through the (load) event.

    Code:
    onClipEvent(load){
    BoxNumber=_root.NumberBox;
    }
    onClipEvent(enterframe){
    _root.GraphicBox.goto&Play.BoxNumber;
    }
    What i'm trying to do is to duplacate a mc and change the look of the GraphicBox. In the GraphicBox mc there is on 4 frames diffrent graphics.
    The BoxNumber just moves to the frame number.

    Problem what i'm getting is when the first mc drops down the stage it shows the right graphic but whe the second mc comes onto the stage the first changes to the second...

    Any idea what i'm doing wrong....

    Heres the link..
    http://fruitfiesta.awardspace.co.uk/

    Ivorsmallun...
    Last edited by ivorsmallun; 01-24-2007 at 07:07 AM.

  2. #2
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,227
    Sorry, but I still dont understand what you are trying to do. At least the line in enterFrame event is completely wrong and should not do anything, correct way to change frames would look something like this:

    _root.GraphicBox.gotoAndPlay(BoxNumber);

  3. #3
    But it still fills prams ivorsmallun's Avatar
    Join Date
    Jul 2001
    Location
    Far Far Away
    Posts
    400
    Thanks for the quick reply tonypa.
    Sorry about the code as i wrote it from memory and it would not have looked like that anyway.

    I'll post a link to the game soon to show whats going wrong.
    You will see fruit fall from the top. Every so often a bonus box will float down with a symbol on it. If you look closer the symbol will change when a new bonus box appears. This is the problem...

    Here is the link...

    http://fruitfiesta.awardspace.co.uk/

    Thanks...

    Ivorsmallun...
    Last edited by ivorsmallun; 01-24-2007 at 07:08 AM.

  4. #4
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,227
    hm, why you have it in enterframe event anyway? And why you want to use gotoAndPlay? All you need to do, is to send it into correct frame once it has been loaded:

    onClipEvent(load){
    _root.GraphicBox.gotoAndStop(_root.NumberBox);
    }

    Or if the code is in GraphicBox itself, you could could simply use

    this.gotoAndStop(_root.NumberBox);

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