A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: checking for charAt string

  1. #1
    Member
    Join Date
    Aug 2007
    Posts
    33

    checking for charAt string

    Anybody see an issue with the code block below?!?!?!
    AS2 , and I have double checked the names. I am feeding in xml text to a button then trying to check to see if the button has '*' as first character then delete the '*' from the string....

    Code:
    box4.onRollOver = function():Void {
    	this.gotoAndStop("over");
    	alert4._visible = false;
    };
    box4.onRollOut = function():Void {
    	this.gotoAndStop("hold");
    	alert4._visible = true;
    };
    if (A1D4.A1D4text.htmlText.charAt(1) == "*"){
    		A1D4.A1D4text.htmlText = A1D4.A1D4text.htmlText.substr(2, A1D4.A1D4text.htmlText.length);
    		box4.onRelease = function():Void {
    		stopAllSounds();
    		gotoAndStop("right1");
    		}
    	}else{
    		box4.onRelease = function():Void {
    		stopAllSounds();
    		gotoAndStop("wrong1");
    		}
    }

  2. #2
    Member
    Join Date
    Aug 2007
    Posts
    33
    This is starting to work better:

    Code:
    if (this.A1D4.A1D4text.text.charAt(0) == "*"){
    	trace("success");

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