A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: [RESOLVED] really simple variable problem...

  1. #1
    Member
    Join Date
    Oct 2004
    Location
    manchester, england
    Posts
    55

    [RESOLVED] really simple variable problem...

    i must be missing something dead obvious with this one...

    i'm using AS 1, and have the following script in the first frame of a MC:

    Code:
    imageNumber = img007;
    then

    Code:
    //
    createEmptyMovieClip("img007", 0);
    imageNumber._visible = false;
    //
    imageNumber.loadMovie("../cover/007.jpg");
    //
    this.onEnterFrame = function() {
    	BLoaded = imageNumber.getBytesLoaded();
    	BTotal = imageNumber.getBytesTotal();
    	percent = BLoaded/BTotal*100;
    	//
    	if (BLoaded == BTotal && BLoaded>0) {
    		imageNumber._width = 90;
    		imageNumber._height = 70;
    		imageNumber._visible = true;
    		delete this.onEnterFrame;
    		imageNumber._x = 0;
    		imageNumber._y = 0;
    	}
    };
    in the next frame

    (this is to avoid having to retype a new image number throughout the script above)

    please help! cheers

  2. #2
    Member
    Join Date
    Oct 2004
    Location
    manchester, england
    Posts
    55
    sorry... think i may have sorted it, by just changing the script (in the 2nd frame only) to:

    Code:
    //
    createEmptyMovieClip("imageNumber", 0);
    imageNumber._visible = false;
    //
    imageNumber.loadMovie("../cover/007.jpg");
    //
    this.onEnterFrame = function() {
    	BLoaded = imageNumber.getBytesLoaded();
    	BTotal = imageNumber.getBytesTotal();
    	percent = BLoaded/BTotal*100;
    	//
    	if (BLoaded == BTotal && BLoaded>0) {
    		imageNumber._width = 90;
    		imageNumber._height = 70;
    		imageNumber._visible = true;
    		delete this.onEnterFrame;
    		imageNumber._x = 0;
    		imageNumber._y = 0;
    	}
    };

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