Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > General > Gaming and Game Development

Reply
 
Thread Tools Rate Thread Display Modes
Old 04-12-2012, 04:07 PM   #1
kingkongminesh
Registered User
 
Join Date: Apr 2012
Posts: 6
Default [AS3] Image to represent dynamic text

As the title says, just wondering how you would change a dynamic text to display an image changing..

e.g the speed of a car to an rev counter...

thanks in advance for any help, did a some searches on google, and couldnt find any good tutorials
kingkongminesh is offline   Reply With Quote
Old 04-12-2012, 08:53 PM   #2
-:)lauri
Senior Member
 
Join Date: Aug 2008
Location: Helsinki, Finland
Posts: 1,182
Default

As far I'm aware of, there aren't any "One Size Fits All" -method (without a LOT of coding) so could you please elaborate your goals a bit more?
-:)lauri is offline   Reply With Quote
Old 04-12-2012, 11:39 PM   #3
[afz]snickelfitz
Senior Member
 
[afz]snickelfitz's Avatar
 
Join Date: Dec 2011
Location: Tucson, AZ
Posts: 2,331
Default

the "image changing" would be in response to a numeric value.
text is a String value; it's meaningless in terms of it's value relative another String.

What you need to do is convert the String to a Number.
ActionScript Code:
var myText:String = "10"; var myTextField:TextField = new TextField(); myTextField.text = myText; addChild(myTextField); box.width = Number(myTextField.text);
[afz]snickelfitz 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:42 PM.

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