PDA

View Full Version : combobox issue


jleong
06-15-2008, 09:28 AM
Hi, I created a combobox and it's not working while I try to pass the label value to Tweener.addTween(air, {x:Math.random()*stage.stageWidth,
y:Math.random()*stage.stageHeight, time:1,
rotation:Math.random()*300, onComplete:mover,
transition:combo.value});

can any1 please teach me how to do it?

jleong
06-15-2008, 02:29 PM
Hi, it still not working. help me....

import caurina.transitions.*;

import fl.controls.ComboBox;
import fl.data.DataProvider;


var trans:String;

cb.dropdownWidth = 125;
cb.width = 125;
cb.prompt = "transition type";

cb.addItem({label:"Linear", data:1});
cb.addItem({label:"easeInSine", data:2});
cb.addItem({label:"easeOutSine", data:3});
cb.addItem({label:"easeInOutSine", data:4});
cb.addItem({label:"SeaseOutInSine", data:5});
cb.addItem({label:"easeInCubic", data:6});
cb.addItem({label:"easeOutCubic", data:7});
cb.addItem({label:"easeInOutCubic", data:8});
cb.addItem({label:"easeOutInCubic", data:9});
cb.addItem({label:"easeInQuint", data:10});
cb.addItem({label:"easeOutQuint", data:11});
cb.addItem({label:"easeInOutQuint", data:12});
cb.addItem({label:"easeOutInQuint", data:13});
cb.addItem({label:"easeInCirc", data:14});
cb.addItem({label:"easeOutCirc", data:15});
cb.addItem({label:"easeInOutCirc", data:16});
cb.addItem({label:"easeOutInCirc", data:17});
cb.addItem({label:"easeInBack", data:18});
cb.addItem({label:"easeOutBack", data:19});
cb.addItem({label:"easeInOutBack", data:20});
cb.addItem({label:"easeOutInBack", data:21});
cb.addItem({label:"easeInQuad", data:22});
cb.addItem({label:"easeOutQuad", data:23});
cb.addItem({label:"easeInOutQuad", data:24});
cb.addItem({label:"easeOutInQuad", data:25});
cb.addItem({label:"easeInQuart", data:26});
cb.addItem({label:"easeOutQuart", data:27});
cb.addItem({label:"easeInOutQuart", data:28});
cb.addItem({label:"easeOutInQuart", data:29});
cb.addItem({label:"easeInExpo", data:30});
cb.addItem({label:"easeOutExpo", data:31});
cb.addItem({label:"easeInOutExpo", data:32});
cb.addItem({label:"easeOutInExpo", data:33});
cb.addItem({label:"easeInElastic", data:34});
cb.addItem({label:"easeOutElastic", data:35});
cb.addItem({label:"easeInOutElastic", data:36});
cb.addItem({label:"easeOutInElastic", data:37});
cb.addItem({label:"easeInBounce", data:38});
cb.addItem({label:"easeOutBounce", data:39});
cb.addItem({label:"easeInOutBounce", data:40});
cb.addItem({label:"easeOutInBounce", data:"easeOutInBounce"});
cb.addEventListener(Event.CHANGE, typeSelected);

function typeSelected(e:Event) {
trans = (cb.selectedItem.label).toString;
trace(trans)
//mover(trans);
}

function mover(/*t:String*/) {
Tweener.addTween(air, {x:Math.random()*stage.stageWidth,
y:Math.random()*stage.stageHeight, time:1,
rotation:Math.random()*300, onComplete:mover(),
transition:trans});
}

jleong
06-15-2008, 02:29 PM
Hi, it still not working. help me....

import caurina.transitions.*;

import fl.controls.ComboBox;
import fl.data.DataProvider;


var trans:String;

cb.dropdownWidth = 125;
cb.width = 125;
cb.prompt = "transition type";

cb.addItem({label:"Linear", data:1});
cb.addItem({label:"easeInSine", data:2});
cb.addItem({label:"easeOutSine", data:3});
cb.addItem({label:"easeInOutSine", data:4});
cb.addItem({label:"SeaseOutInSine", data:5});
cb.addItem({label:"easeInCubic", data:6});
cb.addItem({label:"easeOutCubic", data:7});
cb.addItem({label:"easeInOutCubic", data:8});
cb.addItem({label:"easeOutInCubic", data:9});
cb.addItem({label:"easeInQuint", data:10});
cb.addItem({label:"easeOutQuint", data:11});
cb.addItem({label:"easeInOutQuint", data:12});
cb.addItem({label:"easeOutInQuint", data:13});
cb.addItem({label:"easeInCirc", data:14});
cb.addItem({label:"easeOutCirc", data:15});
cb.addItem({label:"easeInOutCirc", data:16});
cb.addItem({label:"easeOutInCirc", data:17});
cb.addItem({label:"easeInBack", data:18});
cb.addItem({label:"easeOutBack", data:19});
cb.addItem({label:"easeInOutBack", data:20});
cb.addItem({label:"easeOutInBack", data:21});
cb.addItem({label:"easeInQuad", data:22});
cb.addItem({label:"easeOutQuad", data:23});
cb.addItem({label:"easeInOutQuad", data:24});
cb.addItem({label:"easeOutInQuad", data:25});
cb.addItem({label:"easeInQuart", data:26});
cb.addItem({label:"easeOutQuart", data:27});
cb.addItem({label:"easeInOutQuart", data:28});
cb.addItem({label:"easeOutInQuart", data:29});
cb.addItem({label:"easeInExpo", data:30});
cb.addItem({label:"easeOutExpo", data:31});
cb.addItem({label:"easeInOutExpo", data:32});
cb.addItem({label:"easeOutInExpo", data:33});
cb.addItem({label:"easeInElastic", data:34});
cb.addItem({label:"easeOutElastic", data:35});
cb.addItem({label:"easeInOutElastic", data:36});
cb.addItem({label:"easeOutInElastic", data:37});
cb.addItem({label:"easeInBounce", data:38});
cb.addItem({label:"easeOutBounce", data:39});
cb.addItem({label:"easeInOutBounce", data:40});
cb.addItem({label:"easeOutInBounce", data:"easeOutInBounce"});
cb.addEventListener(Event.CHANGE, typeSelected);

function typeSelected(e:Event) {
trans = (cb.selectedItem.label).toString;
trace(trans)
//mover(trans);
}

function mover(/*t:String*/) {
Tweener.addTween(air, {x:Math.random()*stage.stageWidth,
y:Math.random()*stage.stageHeight, time:1,
rotation:Math.random()*300, onComplete:mover(),
transition:trans});
}