Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 12-10-2011, 04:47 AM   #1
untitled88
Registered User
 
Join Date: Jun 2009
Posts: 35
Default if { labels

I can create an if statement for # of selected items. However, how can I create an if statement for even.label?
I have various labels and would like to create if statements based on if the text in my "labels" match up.

ActionScript Code:
function handle_checkbox_change(event:KcheckboxEvent):void {     trace("value before change : " + event.from);     trace("new value : " + event.to);     trace("checkbox group : " + event.group);     trace("checkbox label : " + event.label);     trace("checkbox attached data : " + event.data);     trace("selected items : " + Kcheckbox.get_selected_items_of("group1"));         if (Kcheckbox.get_selected_items_of("group1").length==1) {         Tweener.addTween(testbox1,{y:222,time:1,transition:"EaseInOutBack"});         trace("1 item is selected");     }
untitled88 is offline   Reply With Quote
Old 12-10-2011, 05:13 AM   #2
LOLFlash
Senior Member
 
Join Date: May 2007
Location: Toronto,Canada
Posts: 530
Default

text in labels cant dispatch Event

You need eventDispatcher to fire function and inside this function check text
LOLFlash is offline   Reply With Quote
Old 12-11-2011, 10:35 PM   #3
kattehus
Registered User
 
Join Date: Dec 2010
Location: Aarhus, Denmark
Posts: 39
Default

You can use a switch statement.
ActionScript Code:
switch (event.label) {     case "something":         //what happens if "something"         break;     case "something else":         //"something else"         break;     default:         //default case         break; }
kattehus is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:09 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.