www.webdeveloper.com
Results 1 to 2 of 2

Thread: Actionscript 3.0 and numeric stepper problem

  1. #1
    Join Date
    Jan 2013
    Posts
    17

    Actionscript 3.0 and numeric stepper problem

    I wasn't sure where to post this, due to being Actionscript (the dying grandparent). There's lots of really smart cookies on here, thought I'd post my problem here.

    OK, so when I trace any numeric stepper, the value is null and doesn't change when I increase or decrease the value.

    Here's my code...

    Code:
    import flash.events.Event;
    import flash.events.MouseEvent;
    
    
    stop(); 
    
    var resort:String;
    var pets:String;
    var adults:String;
    var children:String;
    trace(adultStepper.value);
    trace(childStepper.value);
    
    resortCombo.addEventListener(Event.CHANGE, resortHandler);
    petsCheck.addEventListener(MouseEvent.CLICK, petHandler); 
    adultStepper.addEventListener(Event.CHANGE, adultHandler);
    childStepper.addEventListener(Event.CHANGE, childHandler);
    nextButton.addEventListener(MouseEvent.CLICK, nextpage);
    
    
    function resortHandler(evt:Event):void {
    	 resort = resortCombo.selectedItem.label; 
    	}
    	
    function petHandler(evt:Event):void {
    	 pets = String(petsCheck.selected); 
    	}	
    	
    function adultHandler(evt:Event):void {
    	 adults = String(adultStepper.value);  
    }
    	
    	function childHandler(evt:Event):void {
    		children = String(childStepper.value);
    }
    
    function nextpage(evt:MouseEvent):void {
    	gotoAndStop("lodgePage");
    }

  2. #2
    Join Date
    Jan 2013
    Posts
    17
    OK so I've changed things a little since posting this thread.

    Code:
    function adultHandler(evt:Event):void {
    	trace(adultStepper.value); 
    }
    This is function is successfully displaying a result. However I can't store store this value afterwards.

    Code:
    function adultHandler(evt:Event):void {
    	adults = String(adultStepper.value); 
    }

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles