A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: [F8] Dynamic text appears before menu does

  1. #1
    Senior Member
    Join Date
    Feb 2001
    Posts
    233

    [F8] Dynamic text appears before menu does

    I have a drop down menu with dynamically generated text. However the text appears before the menu drops down (there's a dropping animation and the text appears instantly before the animation actually completes). Also the text appears grainy and looks different from any other text in the scene. I have a 10 frame motion tween as the animation and on the 10th frame I have this code:

    Code:
    stop();
    
    onEnterFrame = function() {
    	for(i=1; i<10; i++) {
    		mc = ciBox.duplicateMovieClip('ciBox'+i, this.getNextHighestDepth());
    		mc.txt.text = (i+1)*0.1;
    	}
    	delete(onEnterFrame);
    }

  2. #2
    Registered User nunomira's Avatar
    Join Date
    May 2002
    Location
    portugal
    Posts
    7,003
    hi,

    I guess you'll have to make sure that the animation is at the frame you want it to be. For example, suppose you want the last frame:
    code:

    animation_mc.onEnterFrame = function()
    {
    if (this._currentframe == this._totalframes)
    {
    // show text here
    delete this.onEnterFrame;
    }
    };


    The piece of code you have only waits one frame, so I guess it's pretty useless.
    It's almost the same as
    code:

    for (i = 1; i < 10; i++)
    {
    mc = ciBox.duplicateMovieClip('ciBox' + i, this.getNextHighestDepth());
    mc.txt.text = (i + 1) * 0.1;
    }



    You can verify that with this piece of code attached to the first frame of a timeline with more frames:
    code:

    this.onEnterFrame = function()
    {
    trace(_currentframe); // outputs 2
    delete this.onEnterFrame;
    };
    trace(_currentframe); // outputs 1


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