A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: How to unLoad onClipEvents????

  1. #1
    web designer
    Join Date
    Apr 2007
    Posts
    28

    How to unLoad onClipEvents????

    Hey Everyone.

    Im having a problem with a unloading a onClipEvent.

    I have a web site which ive set up with a content_mc on the main scene and all the content inside that mc.

    In my main scene i have a photo with a page curl effect, that is set off by a onClipEvent.

    I only want this effect on the home page in the main scene, so how do i unload it after i go into the other pages????

    Ive spent hours trying everything i know..

    Please help!!!!

    Many many thanks


    ck


    My code as is:

    onClipEvent (enterFrame) {
    if (_root._xmouse>_root.x1 and _root._xmouse<_root.x2 and _root._ymouse>_root.y1 and _root._ymouse<_root.y2) {
    tellTarget ("_root.next") {
    gotoAndStop(2);
    }
    } else {
    tellTarget ("_root.next") {
    gotoAndStop(3);
    }
    }
    }

  2. #2
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    First of all you are using Flash 4 code, which is deprecated in Flash 8. Then you better not associate any scripts with objects. Instead you put this in the actionframe where your image (movieclip) is.

    mc.onEnterFrame = function ()
    {
    if (_root._xmouse>_root.x1 and _root._xmouse<_root.x2 and _root._ymouse>_root.y1 and _root._ymouse<_root.y2)
    {
    _root.next.gotoAndStop(2);
    this.onEnterFrame = null;
    } else
    {
    _root.next.gotoAndStop(3);
    this.onEnterFrame = null;
    }
    }
    - The right of the People to create Flash movies shall not be infringed. -

  3. #3
    web designer
    Join Date
    Apr 2007
    Posts
    28

    Page curl stays up.

    Hello Again.

    Flash 4 code! thats how good i am!!

    Okay so i put this on the frame of my page curl_mc.

    It looks good but i have the curl going up but it just stays up.
    What i want is it working on the home page, but when i leave the home page for it to disable or something.

    Is this possible? Or have i got it all wrong?

    Your help has always been great so thank you.

    ck

  4. #4
    web designer
    Join Date
    Apr 2007
    Posts
    28

    .gotIt()

    Okay sorry ive totally got it working fine now.

    Thanks you so much for the push forward.


    ck

  5. #5
    Ryan Thomson EvolveDesigns's Avatar
    Join Date
    Oct 2001
    Location
    British Columbia
    Posts
    3,338
    not too steal your thread.. but IS there a way to unload onclipevents? I've had to work with really old games a few times lately for work and I have no intentions of recoding huge games haha.. just wondering if there's a quick fix to dump the enterFrame?
    Evolve Designs Interactive Media
    the natural selection

  6. #6
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    the only way to unload onclipevents is to unload the clip
    once started they run for the life of the clip, but you can make the event conditional -

    onClipEvent(enterFrame){
    if(someVar==true){..do stuff.].
    }

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