Is It Possible To Change A Text Field From Dynamic Text To Static Text At Runtime?
The reason is because the dynamic text appears to be taking up about 90 % of the CPU usuage and I dont know any other way to reduce the CPU usage.
The text areas pull in lots of data from text files which slows down the program.
Any ideas?
FlashKit > Flash Help > Flash General Help
Posted on: 05-02-2004, 11:39 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Using Buttons To Change The Text File A Dynamic Text Field Loads?
I have a text field that loads text from a text document which works great for the news section of my site. However, is there a way I can keep that same text field and change it's content based on what button is pressed? For instance, if someone is viewing the "news" section of my site, and then they click on the "links" button, can I unload news.txt and load links.txt into that text field?
Change Colour Of TEXT In Dynamic Text Field?
hi,
I am wanting to change the colour of the text in the dynamic text field "myText" ... want to change it to RED (#FF0000) when the count down fucntion turns the dispalyed text to 1...
ActionScript Code:
function countDown(event:TimerEvent):void {
if (currentFrame == 5) {
myText.text = String(250 - timer.currentCount);
if ((250 - timer.currentCount) ==1) {
myText.TextColorType ==#FF0000();
}
HOW?
error - "1093: Syntax error."
Detecting A Text Change In A Dynamic Text Field
I have a dynamic text box that gets its content from an XML file. When the use clicks on a nav item, a different node in the XML is displayed in the text box.
I'm looking for a way for the text box to be able to detect if the text it contains has changed.
I tried this, but it doesn't seem to work:
function test(event:Event): void {
trace("The text has changed");
}
contentTxt.addEventListener(Event.CHANGE, test);
Is there a way to do this?
Is It Possible To Change Dynamic Text To Static Via AS?
Is it possible to do through actionscript? Ideally I want to be able to allow users to INPUT text and then a "confirm" button will lock it in by turning the answer static so they can no longer interact with the field.
Thanks
Can Not Get A Dynamic Text Field To Import At Runtime
OK, guys...here are some total assinine questions I am sure, but this is the first site I am trying to develop totally in flash.
I am trying to get it to pull news onto the news page from a txt file, but can not get it to work. I have tried to emulate the way I did it in the tutorial (which worked fine when I did it, of course...story of life), but every time I go to test the file for the news page the text field will not load. I have worked on this for a week to no avail...I really hope someone can help me.
Now, onto another note: I would REALLY like to find a way to import html tables/etc into some of my pages, but can not figure out how. Any suggestions? Please?
Here is the site URL so far:
http://www.wings-of-fury.com
Dynamic Text Field Resize @ Runtime
Hi guys i am trying to find out to resize a dynamic text filed when data is loaded in from the db to populate it so that there is no need for a scroller.
Cheers
Dynamic Text Field Resize @ Runtime
Hi guys i am trying to find out to resize a dynamic text filed when data is loaded in from the db to populate it so that there is no need for a scroller.
Cheers
Dynamic Text Field During Runtime, Word Wrap
Hi
I have this code fragment on a frame:
this.createTextField ("tData",this.getNextHighestDepth (),189,353,600,100);
tData.text="Alcohol is a powerful drug cause by fermentation of sugars and is the active principle of intoxicating drinks";
I have placed the text onstage during runtime, starting from 189, however, the text is longer than what I have specified. I have specified 600, 100. I do not want to increase the length. How do I wrap the text so that it fits instead of disappearing off the stage? What is the additional code I need to embed?
Thanks.
Trying To Pass Text From Form Text Field To A Flash Dynamic Text Field
Hi, I was hoping someone might enlighten me as to how/if I can do this...
Currently I'm using javascript which works fine to pass text from textfield A to textfield B:
Code:
window.onload=function()
{
document.forms.form1.shirtText.value=document.forms.form1.KitGroupID_16_TextOption_38.value
}
Is there a way to pass the textfield A text to a dynamic text input (flash) as I'd like to use the font embedding flash offers. I can make it work when loading a value from a txt file but I'm not sure how to access the value identified above as KitGroupID_16_TextOption_38 and make it appear in a dynamic input box. Eventually I might want to have 3 font choices for the user but I'd like to just see if I can get this working properly first.
Your help/advice would be greatly appreciated,
-Scott
Loaded Text File Wont Show All Of The Text In Dynamic Text Field
When I load an external text file into flash and display the string in a dynamic text box, not all of the text will show in the text box; and using scroll button to scroll the text doesnt help.
The text that is in the text file is as follows, and as far as I can see there is no reason why all this text shouldnt show in the dynamic text field; by the way all my targets are correct, I know that for fact.
message=Code: Cheat:
BEEPSAGONER Deactivate the censor beeps
DRACULASTEABAGS 50 lives
DUTCHOVENS Frying pan mode
XFYHIJERPWAL IELWZS Debug mode
BOVRILBULLETHOLE Shoot all objects
EASY Easy mode
VERYEASY Very easy mode
SPUNKJOCKEY New death animation
SEXYMANN Birdy & Squirrel scene
Code: Unlock chapter:
PRINCEALBERT Barn Boys
CLAMPIRATE Bats Tower
ANCHOVYBAY Slopranos
MONKEYSCHIN Uga Buga
SPANIELSEARS Spooky
BEELZEBUBSBUM It's War
CHOCOLATESTARFISH The Heist
WELDERSBENCH All chapters and scenes
Code: Unlock Multiplayer character:
WELLYTOP Conker
EASTEREGGSRUS Neo Conker
BILLYMILLROUNDABOUT Gregg the Grim Reaper
CHINDITVICTORY Weasel Henchmen
EATBOX Cavemen
RUSTYSHERIFFSBADGE Sergeant and Tediz Leader
BEEFCURTAINS Zombies and Villagers
Change The "description" Dynamic Text Field Text
hi everyone
i have two button on the stage and a dynamic text field with instance name "description" in my movie.
i want to change the text of the dynamic text field on click of every button.
i dont want to use xml.
vineet
Static Text (device Fonts) Vs. Dynamic Text (anti-alias Non-embedded)
Any thoughts on which is better to use?
When i use static text and device fonts (arial) the text looks great. The text doesn't change so no need to be dynamic.
Or
I use dynamic text (arial) non-embedded and it looks good too. The text doesn't change but leaving it as dynamic makes it render better.
[F8] Dynamic Text Controlled Diff From Static Text? (alpha Question)
hi! i'm trying to fade in a movieclip with text but am running into some problems. the movieclip contains 4 dynamic text boxes which will serve as buttons and 1 static text with a title. however, the tween function is currently only fading in the static text and not the dynamic text boxes.
the main part that i'm talking about starts from "function scaleUp()" and down, but i posted what i have so far for context. with the posted code, the static text will fade in with the tween, but the dynamic text just plops there.
thanks for your help OH, and if you would also like to help, i want to have the 4 dynamic texts fade in one after another; i'm not sure whether or not to use an array or for script....and either way, i'm not really sure how to script that, so if you could help me with that too, that'd be awesome. thanks!
PHP Code:
// place background at 0% alpha
var fadeIn:MovieClip = _root.attachMovie("bg", "bg_mc", 0);
bg_mc._alpha = 0;
// import flash tweens
import mx.transitions.Tween;
import mx.transitions.easing.*;
// on enterframe, tween alpha to 100% and on complete, start centerline function
fadeIn.onEnterFrame = function() {
var bgFadeIn:Tween = new Tween(bg_mc, "_alpha", Strong.easeOut, 0, 100, 2, true);
setTimeout (centerLine, 750)
delete this.onEnterFrame;
};
// places center line (invisible)
function centerLine() {
var introLine:MovieClip = _root.attachMovie("line", "line_mc", 1);
line_mc._x = 450;
line_mc._y = 300;
line_mc._visible = false;
lineTween();
}
// makes line visible and tween out (changing _width)
// on complete, begins scaleUp function
function lineTween() {
line_mc._visible = true;
line_mc._alpha = 50;
var tween:Tween = new Tween(line_mc, "_width", Strong.easeOut, 0, 901, .75, true);
tween.onMotionFinished = function() {
scaleUp();
}
}
// changes _height of rectangle to make box and start fadeText function
function scaleUp() {
var upTween:Tween = new Tween(line_mc, "_height", Strong.easeOut, 1, 200, 1.2, true);
upTween.onMotionFinished = function() {
var placeText:MovieClip = _root.attachMovie("text", "text_mc", 2);
text_mc._x = 0;
text_mc._y = 200;
text_mc._alpha = 0;
text_mc.text0.text = "about";
text_mc.text1.text = "portfolio";
text_mc.text2.text = "photos";
text_mc.text3.text = "contact";
fadeText();
}
}
function fadeText() {
var textTween:Tween = new Tween(text_mc, "_alpha", Strong.easeOut, 0, 100, 3, true);
}
News Ticker: Error While Converting Static Text To Dynamic Text.
I made a simple news ticker. But am stuck with a silly error. I made the text static text. now when I make the text dynamic to load data from xml the text is not visible.
Not sure what is wrong with this.. Any help would be greatly appreciated. Thanks in advance.
Ruben Benjamin
www.rubenbenjamin.com
[CS3] Dynamic Text Field Doens't Change... Help
I don't know what I'm doing wrong, but I can't change dynamically the text field inside a movieclip...
I have a movieclip named movempresa that has inside of it a dynamic textbox called txtempresa. I wanted tho change the text inside that text field when I click a button, but so far I can't make it to work... I tried everything I could think of, but nothing works... I don't know what else to do.
I tried the following:
Code:
_root.movempresa.txtempresa = "some text";
_root.movempresa.txtempresa.text = "some text";
txtempresa = "some text";
txtempresa.text = "some text";
And yes, the movies and the text field have the same instance names than the above. What is going wrong here?
Dynamic Text Field Font Change
Hi guys, i need a little help. I need to know how to set a dynamic fields' font (and other properties) with actionScript. Can anyone help?
I thought it could be something like:
Code:
myDynamicTextField.font = "Comic Sans MS";
or at a long shot:
Code:
myDynamicTextField.setStyle("fontFamily", "Comic Sans MS");
(The second one only seems to work with "TextArea" components from the Components menu)
Change Font Of A Dynamic Text Field With As 2.0
Dear Kirupa,
i'm a new user and i found a part of solution of my problem in this your article:
http://www.kirupa.com/developer/acti...nging_font.htm
Now i need another little help. I need to change the text in the text field from an input text and not from the string associated to the button you have done. It is possible?
You associated this to the buttons:
on (release, rollOver) {
font2 = "<font face="Times New Roman" >Times New Roman</font>";
}
And i would like to do something like this :
on (release, rollOver) {
font2 = "<font face="Arial" >"+inputfont2.text+"</font>";
}
Is it possible? what's wrong? cause i have tried to do this but no way.....
Link To Change Dynamic Text Field
Okay, not sure if this is one that's doable or not.
I have this site I'm working on, which has a blog as part of it... you can see the blog here:
http://www.gpjministries.org/site.php#/blog/
The blog is done with MoveableType... so you'll notice the the "right page" has a list of the previous posts (so far there's only one).
The text on both "pages" (right and left) is loaded dynamically... of course. What I need to do is make the template for the "recent entries" page to create a link that when it's clicked, it changes the content on the "left" page.
The component I'm using for the page flipping is FlashLoaded's pageFlipper... in case anyone needs to know.
Here's the code for the "recent entries" page I'm using... just a plain old link right now.
Code:
content=<MTEntries lastn="10"><a href="<$MTEntryPermalink$>"><$MTEntryTitle$></a></MTEntries>
Any help on this would be greatly appreciated!
How To Change Length Of Dynamic Text Field ?
Hi people,
I am stuck with a problem. i am making a dynamic menu where the characters of a link are not limited. A link could be of 4 characters or 10 chracters.
now i am not able to extend the dynamic text field accordibg to the number of characters. i an able to calculate how many characters the field contains but i am not able to extend the field accordingy.
Can anybody help me out here ??? as i am not able to find any property that enables me to control the field width.
HAVE FUN & TAKE CARE
Pixelwonderz
Change Depth Of Dynamic Text Field
Hi,
I would like to know, how can you change the depth of a dynamic text field, preferably to the highest of all movieclips on stage.
Thanks.
Change Dynamic Text Field With Currentframe
how can i change a dynamic text field using current frame
here my script so far
titletxt.text = "Latha";
daytxt.text = "An Dùbhlachd";
numTxt.text = "21";
if (this.shadows._currentframe == 1) {
timetxt.text = "02:00 m";
}
if (this.shadows._currentframe == 10) {
timetxt.text = "03:00 m";
}
if (this.shadows._currentframe == 20) {
timetxt.text = "04:00 m";
}
thanks
When I Rotate A Dynamic Text Object, The Text Disappears At Runtime
Can someone explain why the text of a dynamic text object disappears at runtime when rotated?
It happened when I rotated a MovieClip object via actionscript that contained a dynamic text object. So, to test whether this happens all the time, I created a movie clip again with a dynamic text object in it, populated the dynamic text object with a single letter, and rotated it by hand and ran the movie - the letter disappeared.
LOL in a happy, rare accident, I discovered the answer myself. Page 432 of the Flash 8 Actionscript Bible says, "Aside from just allowing text to look the way you want it to look, embedded fonts actually enable your Textfield objects to do some things they wouldn't otherwise do. For example ... a TextField object that uses device fonts (nonembedded fonts) cannot be rotated nor can you change the alpha. But once you embed the font, you can do both of these things."
Alright - now to embed that sucker...
How: (for dynamic or input text objects) clicking the Embed button in the Property inspector.
Note, this will increase the size of your swf. Just embedding the lowercase and uppercase letters from a-z of one font increased the swf filesize from 3-9KB.
External Text Loaded Into Text Field Won't Change File Attached
I have 3 textfields in 3 different frames. Each text field is for a different section of my website. I want to keep all the code that works for 1 textfield and just change the URL that is loaded. I tried so many different ways. I don't get a error so I believe the URL is being cached somewhere. When I trace it It shows that the other text doc has loaded but the text field doesn't show any change. Is there away to reload/stop cache/delete a variable?
PHP Code:
stop();var newsURL:String = "text/news.txt"//Below is other variables if you wanted to swap out the actual variable versus the url./*bioURL:String = "text/bio.txt"tourURL:String = "text/tour.txt"*///var newsURL:String = "text/news.txt"var textLoader:URLLoader = new URLLoader(); var textReq:URLRequest = new URLRequest(newsURL);var style:StyleSheet = new StyleSheet();//style defined belowstyle.setStyle("a" , {color:"#CC0000"});style.setStyle("a:hover", {textDecoration:"underline"});function textLoaded(event:Event):void{ text_mc.text_txt.styleSheet = style; text_mc.text_txt.htmlText = textLoader.data; }textLoader.load(textReq);text_mc.text_txt.autoSize = TextFieldAutoSize.LEFT;textLoader.addEventListener(Event.COMPLETE, textLoaded);function onClickNews(event:MouseEvent):void{ newsURL = "text/news.txt";// I tried including this in the button textLoader.load(textReq);// also this gotoAndStop(1);}news_btn.addEventListener(MouseEvent.CLICK,onClickNews);function onClickBio(event:MouseEvent):void{ newsURL = "text/bio.txt"; gotoAndStop(2);}bio_btn.addEventListener(MouseEvent.CLICK,onClickBio);function onClickTour(event:MouseEvent):void{ newsURL = "text/tour.txt" //var newsURL:String = "text/tour.txt" gotoAndStop(3);}tour_btn.addEventListener(MouseEvent.CLICK,onClickTour);
Please help Thanks
http://www.theofficialvip.com/testUR...RLSwitcher.zip
Load Text From A Text File Into A Dynamic Text Field
I'm trying to load text from a text file into a dynamic text field. The text field is on the "blog" page of the website. When I test my movie, the first time I go to the blog page, the text from the external text file (AND the CSS styles) show up fine. But when I click from the blog page to go to the "profit calculator" or "contact" pages and THEN click to go BACK to the blog page, the blog page animates back in, and right as the animation ends, the text on the blog page suddenly disappears and won't come back. PLEASE help me figure this out!
Why Is Dynamic Text Crisp & Static Text Blurred?
Why is this? I thought the purpose of Dynamic text was so that it could change. But it also looks more defined then Static text. But Static text is not limited to one font, size and style. Is there a way to make Static text look crisp like Dynamic text?
Thanks!
HELP Can INPUT BOX Number Value Change A Dynamic Text Field?
Yeah, I am trying to get my input field to change the value of a dynamic text box, which is accessing a variable from a .txt file.
The input field is called "Quantity1", "Quantity2", etc...
The Dynamic text fields load variables called "Price1", "Price2", etc...
Both go up to 10.
If I input a value, let's say 10, into "quantity4", then "price4" should change accordingly.
HOW CAN I DO THIS?
Dynamic Text Field Won't Change Color When Hovering
Hi,
I attached my .fla file (I think) which contains the problem.
It contains a dynamic textfield with hyperlinks. I want this link to change its color when a rollover occurs.
I thought I could just swap the last frame of my MC with a graphic which contains the rollover, but this doesn't work and I can't figure out why
Color Change And Autosize On Dynamic Text Field
I have a script that loads a .txt file to a dynamic textfield. I need to have the text change in color when the mouseover. I've created a button out of that textfield and created its rollover state. It works fine, but then i also need to automatically resize the textfield to fit nicely with the amount of text loaded.
It works fine with autoSize property if the textfield is not inside a button. But once i put the textfield inside a button, it doesn't work.
This is what i have:
a dynamic textfield inside a button inside a movieclip.
The scripts on root timeline:
Code:
loadVariables ("txtFiles/clientNames.txt","myClip");//this loads fine
_root.myMovieClip.myButton.myTextField.autosize = left;//this doesn't work
Help anyone? Or is there an easier way to have the text color change when mouseover a dynamic textfield?
Thanks in advance,
Using Drag & Drop To Change Dynamic Text Field
Hi Everyone! I'm new to Flash and am a bit confused, but I will try to keep this as simple as possible. I am creating a quiz where the user will drag a word over a picture and if it is correct, a dynamic text field over the picture will display the word "YES".
Here is the script I have thus far:
code:
on(press) {
startDrag(this);
_root.answer="";
}
on(release) {
stopDrag();
if (this._droptarget == "/DTOffice") {
_root.answer="YES";
}
}
"DTOffice" is the name of my movie clip and is the correct destination for the dragged word.
QUESTIONS
1. I feel like my problem may be with button usage? Right now, everything is a movie clip (the draggable word and the destination box). Does there have to be a button involved somewhere?
2. My destination movie clip ("DTOffice"), should that be a variable name? an Instance name? I know my problem is in that line of code because if I put any text in the 2nd line (under startDrag where it sets the value of the dynamic field initially), it will display correctly. ALSO, if I put an else statement after the if (to say else root.answer="NO"), the code will go right to the else statement and will display "NO" the entire time.
I hope this makes sense and somebody can help me out, I appreciate any help or advice anyone can provide!
Using Combo Box To Change Fonts On A Dynamic Text Field
hey guys and gals i need so more help... i have been searching all day to see if anyone has an answer to this question. how would you go about using a combo box to change fonts?
in the combo box there are like 15 different fonts. arial, bookman old style etc. I want to be able to change the the text field font from selecting an option in the combo box... any help is greatly appreciated.
Change The Text Within A Text Field Embedded In A Button
Can you change the text within a field embedded in a button?
I am trying to create an dymamic A-Z index.
A B C D E........,
jumping to a frame label on the timeline.
I am trying to re-use only one instance, a button containing a dymamic text field to change
the buttons label when the movie loads.
So "button A" reads "A" and "button B" reads "B" and so on.
I cant seem to access the text field within the button using dot syntax.
Is ther a better way to do this?
Converting Dynamic Text Box To Static Text Box
Hello there!
Im working on a flash movie and i want to do the following
1) to edit the text - using an xml-file
2) When the text is done i want to have only one .swf file that i can
put on my website, so that vistors worldwide only have to download 1
file containing both flash slide/sequence and the text that i have edited. The swf file should be non-XML dependent after i edited the XML file
I already figured out how to display the contents of my XML file in my flash movie.
Can anybody help me with this?
|