Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 04-01-2003, 11:06 AM   #1
roodkapje
Registered User
 
Join Date: Apr 2003
Posts: 3
Default textfield fontsize probably simple please help

ah, my first post... glad to find you all here....

if somebody doesn't help me i'm gonna cry...
before you say, "that won't solve your problem" understand that i've been working on this site for threew= weeks straight.
i've got actionscript coming out of my hair follicles!!! AAA!!!

so yeah, um... heres the problem...
i hope someone can tell me what i am doing wrong.

i need to change the size of a font depending on how much text is loaded into a text box (from an xml file) the font is i guess what one calls ëmbedded meaning i specified it to be included with the flash movie here is my code so far:

if ( thisTxt != "" ){
thurston.teenAgeRiot = thisTxt
if ( thisTxt.length < 100 ){
thisTextFormat = new TextFormat();
thisTextFormat.size = 80;
thurston.teenAgeRiot.setTextFormat(thisTextFormat) ;
}
else {
thisTextFormat = new TextFormat();
thisTextFormat.size = 20;
thurston.teenAgeRiot.setTextFormat(thisTextFormat) ;
}
}
else {
thurston.teenAgeRiot = ""
}

}

i've never tried to use this setTextFormat thingy before so i am understandable confuuuuused
roodkapje is offline   Reply With Quote
Old 04-01-2003, 11:23 AM   #2
Billy T
Oops I did it again
 
Billy T's Avatar
 
Join Date: Oct 2001
Location: Melbourne
Posts: 8,579
Default

so what's it doing?

looks like you've got an else statement without an if statement but maybe you didnt post all the code...
__________________
Billy
Online Galleries
iPhone Safety App - iStaySafe
Free Flash Video Tutorials
Photo Website Template

Don't email or PM me questions...
Billy T is offline   Reply With Quote
Old 04-01-2003, 11:33 AM   #3
roodkapje
Registered User
 
Join Date: Apr 2003
Posts: 3
Default

i didn't post everything, i couldn't possibly....
but what maddness you see there is an 'if/else' statement inside an 'if/else' statement

IF there is txt (thisTxt != "")
then go ahead and print it
then
IF the txt.length is < 100 (characters?)
then make it one size ....
ELSE make it a different size
otherwise ELSE
don't print anything (because there was no txt, see first IF statement)

*eep!
roodkapje is offline   Reply With Quote
Old 04-01-2003, 11:40 AM   #4
Billy T
Oops I did it again
 
Billy T's Avatar
 
Join Date: Oct 2001
Location: Melbourne
Posts: 8,579
Default

well you have one too many } for that to be the case but anyway...

what's it doing wrong?
__________________
Billy
Online Galleries
iPhone Safety App - iStaySafe
Free Flash Video Tutorials
Photo Website Template

Don't email or PM me questions...
Billy T is offline   Reply With Quote
Old 04-01-2003, 11:43 AM   #5
roodkapje
Registered User
 
Join Date: Apr 2003
Posts: 3
Default

alright, for the sake of my sanity and anyone elses who has a problem of this sort i willl tell you how it was solved.

i had to call the Instance Name of the text filed, which in this case is 'starPower' and *not* the Variable Name which in this case is 'teenAgeRiot'

sorry, knew it was something simple... i am new to using MX... didn't have that Instance Name on a text field thing in my day

thank you anyway.
roodkapje 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 Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:11 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.