14th Mar 2010

Transitions error

  • Hi

    I have some problems with transitions. They work fine for the most part, but if you click on a button before the transition is done, it gets screwed up (does not load the new swf files correctly). My code for each button is (I have 6 main buttons):
    }

    on (release) {
    if (_root.currMovie == undefined) {
    _root.currMovie = "bgstartT";
    _root.container.loadMovie("bgstartT.swf");
    } else if (_root.currMovie != "bgstartT") {
    if (container._currentframe >= container.midframe) {
    _root.currMovie = "bgstartT";
    _root.container.play();


    if (_root.currSub == undefined) {
    _root.currSub = "startT";
    _root.container2.loadMovie("startT.swf");
    } else if (_root.currSub != "startT") {
    if (container2._currentframe >= container.midframe) {
    _root.currSub = "startT";
    _root.container2.play();
    unloadMovieNum(4);
    }
    }
    }
    }
    }

    Each button has the same setup as above, but loads ofther swf's. The transitions each lasts for 10-15 frames, so they are not very long, but if you happen to click on on of the other buttons before it has reached it's midframe, they will most times load one of the swf's but not the other. Is there a way to force the swf's to not load, unless both do? Sorry for being a bit blurry, but I've spent so many hours on this and can't find a solution. Please help me :cantlook:


  • Nobody? Please?

    With the code posted in original message, I think I lack some coding between loading the Movie and loading the Sub, that tells if the Movie is loaded, go ahead and load the sub, and if the movie is not loaded, load both the movie and the sub. Makes sense?

    Sorry for pushing it, my head will explode soon if I don't find a solution


  • im not sure i fully understand. are you trying to add actions so that the buttons can only be pressed when the transisiton ISNT in progress, so that the buttons cant "mess up" the transition, if you are, then here is the code for the buttons. The bits that you wrote are black, the bits that i added are red.

    on (release) {
    if (!_root.transition) {
    if (_root.currMovie == undefined) {
    _root.currMovie = "bgstartT";
    _root.container.loadMovie("bgstartT.swf");
    } else if (_root.currMovie != "bgstartT") {
    if (container._currentframe>=container.midframe) {
    _root.currMovie = "bgstartT";
    _root.container.play();
    if (_root.currSub == undefined) {
    _root.currSub = "startT";
    _root.container2.loadMovie("startT.swf");
    } else if (_root.currSub != "startT") {
    if (container2._currentframe>=container.midframe) {
    _root.currSub = "startT";
    _root.container2.play();
    unloadMovieNum(4);
    }
    }
    }
    }
    } else if (transition) {
    }
    }

    you will then need to convert the last frame of your transition sequence into a keyframe (NOT a blank keyframe..) and add these actions to the frame:

    _root.transition = false

    then, on the first frame of your transition sequence (which does not need to be a keyframe) simply put these actions:

    _root.transition = true


    this code is simple. the if statement i added checks to see if the variable "transition" is false, and if it is false, the button uses its actions. the else part of the statement is excecuted when transition is true, and it does nothing.

    this basically means that when the play head runs through your transition sequence, transition = true, so the button will have no action. when the playhead reaches the last frame in your transition sequence, transition = false, so the button has its actions once more.

    hope this helped, if not, please post your fla (or a link to it)


  • Thank you, that is what I was trying to do. There are definitely much less errors, but they still happen. The projekt is 25 swf's, so it's a bit tricky to post the fla's. But please, if you don't mind having a look:
    http://www.radicaldreamers.se/start.php

    What happens is that if you click on a new submenu button before the current transitions are done, it might load the submovie on top of the wrong background. The bg-images (6) are each separate swf's, and all the submenu buttons are separate swf's. The all have transitions.
    The menubar on top is also a separate swf, I can post the fla to that one if it helps?

    Thanks again, I really appreciate your help!!







  • #If you have any other info about this subject , Please add it free.#
    Your name:
    E-mail:
    Telphone:

    Your comments:


    If you have any other info about Transitions error , Please add it free.

    Posted by admin under toyotataa.com |


    RSS