Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Actionscript 3.0 and numeric stepper problem

Guest
Mar 08, 2014 Mar 08, 2014

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

}

TOPICS
ActionScript
470
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 08, 2014 Mar 08, 2014

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Mar 08, 2014 Mar 08, 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;

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 08, 2014 Mar 08, 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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Mar 08, 2014 Mar 08, 2014

You know what happened? Feels quite silly saying this.... Numbers wasn't embedded in fonts.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 08, 2014 Mar 08, 2014
LATEST

That can do it. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines