dcsimg
A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: JavaScript want to kill me

  1. #1
    Junior Member
    Join Date
    Sep 2008
    Location
    London
    Posts
    20

    JavaScript want to kill me

    Hi guys.

    Ok, my latest problem which is beating me up is this:

    I have a base.swf, which loads various other swfs into it, and a frame with the name "firstlvl".

    Then I have a bunch of JavaScript, which for the most part, seems to be getting along with eachother quite nicely.

    However, one certain function is misbehaving. It is:

    flashMovie.GotoFrame('firstlvl');


    When the function containing this info is read, it jumps to the first frame instead of the frame with the right label.

    I have NO idea why, but I have a slight feeling that it MIGHT have something to do with the Preloader in the first scene. When i remove this preloader, however, it gets even more unpredictable.

    Anybody know anything about this? Or ask any questions to help me ask clearer.

    Thanks!

  2. #2
    Junior Member
    Join Date
    Sep 2008
    Location
    London
    Posts
    20
    Ok, just to update that the JavaScript isn't sending the flashmovie to ANY frame. It basically reads like this:

    function noTouch(movie, part) {
    var flashMovie=getFlashMovieObject(movie);

    if(part == 1) {
    flashMovie.GotoFrame('firstlvl');
    } else if(part == 2) {
    flashMovie.GotoFrame('secondlvl02');
    } else if(part == 3) {
    flashMovie.GotoFrame('thirdlvl02');
    }
    }



    But when you call the noTouch function, it always sends the base.swf back to the first frame.

    HEEEYELP!!!

  3. #3
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    try -

    flashMovie.TGotoLabel("_level0/","firstlvl");

  4. #4
    Junior Member
    Join Date
    Sep 2008
    Location
    London
    Posts
    20
    Dude, I feel like i should pay you money or something!! You rock my world! Thanks!!!!!!!!!!!!!!!!!!!!!

  5. #5
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    no probs

    GotoFrame (x): "x" must be an integer (frame number)

    check this link for more on javascript/flash -
    http://www.moock.org/webdesign/flash...and/index.html

  6. #6
    Junior Member
    Join Date
    Sep 2008
    Location
    London
    Posts
    20
    Thanks bro. I think the sad truth is just that I suck.

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