Results 1 to 6 of 6

Thread: Simple ActionScript _framesloaded help wanted

  1. #1
    Join Date
    Apr 2008
    Posts
    22
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Question Simple ActionScript _framesloaded help wanted

    This doesn't do what I want it to do, the frames just play right through till the end. I wanted to use the if else statement, but I guess I'm not writing it out correctly.

    Code:
    if (_framesloaded==("Scene 1", "label 100")) {
    	gotoAndPlay("preloader", "label 50");
    } else { 
    	gotoAndPlay("preloader", "label 10");
    }
    Any insight?

    Thanks


  2. #2
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    What exactly are you trying to do? What is "Scene 1" representing?

    ("Scene 1", "label 100") isn't a valid ActionScript object. Even if it were, it wouldn't equal the numberical value of _framesloaded.

  3. #3
    Join Date
    Apr 2008
    Posts
    22
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    I have seven scenes in a one flash movie, each named Scene 1, Scene 2, Scene 3 etc... There is a label in Scene 1 named label 100.

    It used to be written like this:

    Code:
    ifFrameLoaded ("Scene 1", "label 100") {
    	gotoAndPlay("preloader", "label 10");
    }
    That worked, but I wanted more control.


  4. #4
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    If you know what frame ("Scene 1", "label 100") refers to...you can use the same logic as in your first post just replace ("Scene 1", "label 100") with the frame number.

  5. #5
    Join Date
    Apr 2008
    Posts
    22
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    Scene 1 is a new scene in the Flash movie file. Label 100 does refer to a frame number in Scene 1, but I'm trying to send the movie to the label, not the frame because the movie my grow or shrink, and the frame number my not stay consistent as I work on the scene.

    The ifFrameLoaded sample works fine with the literal names of the scene and label within the quote marks.

    I think the problem is my attempt at ActionScript coding.


  6. #6
    Join Date
    Jul 2009
    Posts
    13
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Search on google for the AS you are confused about before posting on a forum. for example a quick google search brought me to Adobe's site for the two actionscript codes, and showed me what you were doing wrong:

    ifFramesLoaded
    http://www.adobe.com/support/flash/a...ionary386.html

    _framesloaded
    http://www.adobe.com/support/flash/a...ionary522.html


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •