A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: [AS2] Won't remove and replace MovieClip when key is pressed

Hybrid View

  1. #1
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    No, "characterContainer" has already been created, dynamically, hence the code (createEmptyMovieClip)
    It is just being referenced with the name clipHolder.

    I will leave it up to you to decide about AS3 or not, it is slightly more verbose and long windied sometimes, yes, but the logic shies through.

  2. #2
    Registered User
    Join Date
    Apr 2015
    Posts
    4
    Quote Originally Posted by fruitbeard View Post
    Hi,

    No, "characterContainer" has already been created, dynamically, hence the code (createEmptyMovieClip)
    It is just being referenced with the name clipHolder.

    I will leave it up to you to decide about AS3 or not, it is slightly more verbose and long windied sometimes, yes, but the logic shies through.
    I think I'm going to go to AS3 since I have already purchased Flash CS6.
    But I'm still curious about some aspects of AS2 before moving on to the higher version.
    I'm trying to make a text displayer that will disappear about 2 seconds.

    Code:
    var textA:String;
    var textB:String;
    var textDelTimer:Number = setTimeout(textDelTimer, 2000, delText)
    
    function displaytext(){
    	this.createTextField(instanceName="textFieldA", this.getNextHighestDepth(), 0, 20, 500, 60);
    	textFieldA.selectable = false;
    	textFieldA.text = textA;
    	this.createTextField(instanceName="textFieldB", this.getNextHighestDepth(), 0, 20, 500, 120);
    	textFieldB.selectable = false;
    	textFieldB.text = textB;
    	delText(textFieldA);
    	delText(textFieldB);
    }
    	
    function delText(){
    	this.removeTextField();
    }
    
    textA = "hello";
    textB = "world2";
    Although there were no errors when compiling, the texts don't even appear.
    I want to make it available in Scene 1.
    I would like the text to look somehow like this.

    SCRMEGA.jpg

    maomao3.PNG

Tags for this Thread

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