A Flash Developer Resource Site

Results 1 to 11 of 11

Thread: don't laugh: simple gotoAndStop/Play problem...

Threaded View

  1. #1
    DOT-INVADER marmotte's Avatar
    Join Date
    May 2002
    Location
    Dot-Switzerland
    Posts
    2,601

    don't laugh: simple gotoAndStop/Play problem...

    ok, i have noticed something:
    code:

    gotoAndStop(5);
    trace("hello");


    ^ it traces "hello". without using any if statment, is there a way that flash goes to frame 5 without reading all the code that is above the gotoAndPlay()? imagine that the trace here is in my game something like 300 lines of code that i don't want to be calculated anymore...
    another example:
    code:

    function next_f(frame) {
    delete next_f;
    gotoAndStop(frame);
    trace_f();
    }
    function trace_f() {
    trace(_currentframe);
    }
    next_f(5);


    here, even by deleting the function, it's still read in its intergrity before being deleted.

    that one works, but that's not what i want:
    code:

    function next_f(frame) {
    delete trace_f;
    gotoAndStop(frame);
    trace_f();
    }
    function trace_f() {
    trace(_currentframe);
    }
    next_f(5);



    ok, basically what i want: is there a way to "break" a code before it's finished, like the break; method that works with for loops? i mean, without using if statments everywhere, because i have TONS of code (it's for my fighting game)

    here's a better description of the little problem i have:
    that fighting game require a lot of keys interaction, and is filled with tons of function... imagine that at the same frame, the player attacks and exactely at the same time recieve a hit > so there are here 2 times a gotoAndPlay() at the same time. what's the result?
    the enemy loses life, the hit effect is attached, but he doesn't play his hit animation and directly goes to his attack animation... it's probably like saying:
    code:

    gotoAndPlay("hit")
    // lose life, etc
    gotoAndPlay("attack")


    ok, it's not the only example i have, but when it occurs, it's not funny :-(

    oh, another question, sometimes flash seems to be confused... a gotoAndStop() becomes gotoAndPlay(), or goes to a wrong frame (never mentioned by me since it was a blank and unlabelled frame in the middle of the movie), some _x/_y values may be wrong (that's true!) etc...
    i'm now in the process of cleaning the code a bit, since the engine is almost finished, but i want the game to look the best possible and get rid of all these little annoying bugs.
    so my question is: using a lot of values that have almost the same may confuse flash or not? example:
    var key_checker
    function key_checker
    var key_check_minus
    var key_check_error
    ...etc...
    ^ these names are quite similar, do you think they may perturb flash?

    thanks for any response
    Last edited by marmotte; 09-03-2003 at 08:34 AM.

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