Skip to main content
March 8, 2014
Question

Actionscript 3.0 and numeric stepper problem

  • March 8, 2014
  • 1 reply
  • 509 views

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...

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");

}

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
March 8, 2014

the only trace functions shown execute before your steppers change.  is there a problem after a stepper changes?

March 8, 2014

OK so I moved the trace function inside the adultHandler function and traced the adult variable.

trace(adults);

The results are being stored properly inside the varaible, which is good. However, I can't get it to display inside a text box on frame 4.

adultsSelected.text = adults;

childrenSelected.text = children;

Ned Murphy
Legend
March 9, 2014

Does the frame/layer where the variables are defined extend as far as frame 4? Does that code assigning the text execute when you are in frame 4?