Controlling Text Field
Im trying to control a text field from another movieclip. However I can't seem to assign a font to the text field from the movieclip . How do you do it?
FlashKit > Flash Help > Flash ActionScript
Posted on: 05-30-2002, 02:33 PM
View Complete Forum Thread with Replies
Sponsored Links:
Controlling Movie From Text Field
First, thanks to actionscript.org. I am creating a touchscreen mall kiosk. I have each of the stores assigned to a named frame (G12 or R7 etc.) I have created all of the touch navigation for exploring the mall. That was easy as I am a graphic artist, not so much a programmer. To the right I would like a text list view of the stores, one alphbetical and one by catagory. If I create a Dynamic text field I can show the names but can't attach any action to jump to the appropriate frame. For the touch the store graphic and enlarge portion I am using buttons with:
on (release) {
gotoAndStop("B11");
}
Can someone suggest a way to get the side navigation working. It is a long list and must scroll. HTML? XML? Dynamic Text?
Thanks in advance
Chris
View Replies !
View Related
Controlling Movie From Input Text Field
Basically I've made a chat where each user has their own chat window (a word bubble above their head) and i want actions seen by all chatters to take place based on what is in their chat window.
In the below code 'fiveoutput' refers to one users chat window.
The Plan:
To control flash elements from an input field
The Script:
onClipEvent (enterFrame){
if (fiveoutput == "chant"){
_root.actionClip.gotoAndStop("chant");
}
else (_root.actionClip.gotoAndStop(1));
}
This works for another input field I used, but this one is updated from a txt file. Anyone know why it wouldn't work?
Thanks for ANYTHING you can suggest
View Replies !
View Related
Controlling A Text Field From A Seperate Movieclip
Hi I wonder if anyone can help me on this annoying bit of script i am trying to figure out.
I have built a photogallery that loads images and text into an empty movieclip(picture) and textfields(desc_txt, media_txt & credit_txt) from an XML file and displays thumbnails.
I would like to make the text invisble until you RollOver the image. 5 thought thsi would be quite simple but cannot get it to work.
below is the code i am using, with all the textfields placed in a movieclip with an instance of text_mc. can somebody please point me out where i am going wrong or offer any advice, i am so close to the end of this project now its frustrating ther is only this little glitch and one other to fix and i will have done.
Code:
text_mc._alpha = 0;
picture.onRollOver = function() {
picture.onEnterFrame = function() {
if (text_mc._alpha<100 ) {
text_mc._alpha += 15 ;
} else {
text_mc._alpha = 100;
picture.onEnterFrame = null;
}
};
};
picture.onRollOut = function() {
picture.onEnterFrame = function() {
if (text_mc._alpha>100) {
text_mc._alpha -= 15;
} else {
text_mc._alpha = 100;
picture.onEnterFrame = null;
}
};
};
View Replies !
View Related
Controlling A Movieclip With A Value In A Dynamic Text Field
Okay I know all you experts are going to be laughing your asses off at me, but I am trying to solve this issue anyways.
I have a movieclip called pointer.mc and this movieclip has only two frames, on the first one the arrow points up and I have a stop(); action on this so it does not jump to the next frame which has the arrow pointing down and this frame also has a stop(); action on it.
Then I have a dynamic text field with an instance name of tiderise which is calling a variable from a seperate .txt file called tiderise.txt and the variable is &rise= . Now I have programmed the .txt file to only supply two variables either "up" or "down" and these change periodically during the day. (I am actually making an animated tide chart if you haven't guessed already)
What I want is to get some coding that will control the movieclip pointer.mc between frame 1 and frame 2 depending on the value in the dynamic text field with an instance name of "tiderise" that can only return the value's of "up" or "down"
Hope someone can help, I have spent already about 2 hours trying to figure this out with no luck, I only seem to be able to control other dynamic text fields with values from another dynamic text field, but cannot seem to get this to work on a movieclip.
Thanks.
View Replies !
View Related
Controlling A Text Field With A Seperate Movieclip?
Hi I wonder if anyone can help me on this annoying bit of script i am trying to figure out.
I have built a photogallery that loads images and text into an empty movieclip(picture) and textfields(desc_txt, media_txt & credit_txt) from an XML file and displays thumbnails.
I would like to make the text invisble until you RollOver the image. 5 thought thsi would be quite simple but cannot get it to work.
below is the code i am using, with all the textfields placed in a movieclip with an instance of text_mc. can somebody please point me out where i am going wrong or offer any advice, i am so close to the end of this project now its frustrating ther is only this little glitch and one other to fix and i will have done.
Code:
text_mc._alpha = 0;
picture.onRollOver = function() {
picture.onEnterFrame = function() {
if (text_mc._alpha<100 ) {
text_mc._alpha += 15 ;
} else {
text_mc._alpha = 100;
picture.onEnterFrame = null;
}
};
};
picture.onRollOut = function() {
picture.onEnterFrame = function() {
if (text_mc._alpha>100) {
text_mc._alpha -= 15;
} else {
text_mc._alpha = 100;
picture.onEnterFrame = null;
}
};
};
View Replies !
View Related
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
View Replies !
View Related
Controlling _yscale With An Input Field...help
Hi,
I have a movieclip on main stage called "box_mc". The current dimension for this clip are:
_x: 30
_y: 5
I would like to be able to control this movieclips height with an user input field which I have it on stage named "height_txt".
my code:
PHP Code:
onEnterFrame = function()
{
var textfield = _root.height_txt.text;
_root.box_mc._yscale = textfield;
}
My code works but isn't accurate. Can anyone help me point out what am I doing wrong?
Thanx.
View Replies !
View Related
Calculating Input Text Field To Dynamic Field (easy Action Script)
hi. i'm trying to learn action script and i need help with this bit. i'm trying to use action script to calculate my brothers ages based on my own.
using flash MX. i have an input field called "my_age" and two dynamic fields called "eli_age" and "jacob_age". eli is 4 years younger and jacob is 6 years younger. i want to be able to enter my age in the "my_age" input field and then click a button that will calculate their respective ages.
here's the fla if i haven't been clear.
thanks for any/all help,
josh
View Replies !
View Related
[FMX04] AS - Showing Text Field As HTML Field With XML/CDATA.
Hey all -
Trying to get a text field in my Flash MX movie to pull from and XML file with CDATA tags to show as HTML. I've checked the box to render as HTML for the text data field... but I'm having problems with the Actionscripting.
The field from this line is what I need to recognize as HTML reading CDATA tags:
this.ref["textField"+i].text = subnodes[3].firstChild.toString()
I know I need to do more than just change it to ".html" instead of ".text" and have tried a couple things, but nothing seems to work.
Any help greatly appreciated!
Code:
//Create the XML Object
myXML = new XML ();
myXML.load(newXml);
myXML.ignoreWhite = true;
//Load XML file
myXML.load("PBintro.xml");
//Make a reference to current timeline
myXML.ref = this
// Parse XML and fetch
myXML.onLoad = function(success){
if(success){
var root = this.firstChild ;
nodes = root.childNodes
for(var i=0; i<nodes.length; i++) {
this.ref["Title_txt"+i].text = nodes[i].attributes.name
subnodes = nodes[i].childNodes
this.ref["Comments_txt"+i].text = subnodes[0].firstChild.toString()
this.ref["Link_txt"+i].text = subnodes[0].firstChild.toString()
this.ref["Link_txt"+i] = subnodes[1].firstChild.toString()
this.ref["holder_mc"+i].loadMovie(subnodes[2].firstChild.toString())
this.ref["textField"+i].text = subnodes[3].firstChild.toString()
this.ref["textField"+i] = subnodes[4].firstChild.toString()
}
} else trace("Error loading XML document")
}
View Replies !
View Related
Input Text Field To Dynamic Text Field
Ok, I have an input text field with a variable name of "enter", and a dynamic text field with a variable name of "display". I also have a button on the stage. I want it so that when you press the button, it checks what the user has put into the input text field, and if it is valid it will display a certain message in the dynamic text field.
For example:
If the user types in "hydrogen" and then clicks the button, I want the dynamic text field to display the letter H. Likewise, if the user types in "oxygen" and then clicks the button, I want the dynamic text field to display the letter O. And finally, if the user types in something that is not specified in the code, it will just display "Not Valid".
I tried doing this with an on(release) action and then some if statements, but nomatter what I typed in it would always display H. I'm probably overlooking something simple, but nonetheless, I need help. Thanks
View Replies !
View Related
XML And MC Text Field Propigation (text Field Appear At Frame 2)
I am using xml and actionscript to propicate two fields in a mc.
The problem I am having is that both fields dont show up until the second frame of the mc. since they are not on the first frame the xml doesnt propicate the fields.
Is there any way to refence a field on the second from of a MC
I am using the following code:
Code:
function loadXML(loaded) {
if (loaded) {
_root.attractions = this.firstChild.childNodes[0].childNodes[0].firstChild.nodeValue;
_root.description = this.firstChild.childNodes[0].childNodes[1].firstChild.nodeValue;
_root.theaterinfo.header.text = _root.attractions;
_root.theaterinfo.description.text = _root.description;
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("attractions.xml");
stop();
The text boxs header and description dont appear until the second frame of the MC theaterinfo
If i move these text field to the first frame they propigate with their text just fine. once they are moved to the second frame they no longer work.
edit: I also would like to mention that the movie clip theaterinfo has frame one blank with a stop(); command and then on frame 2 the dynamic text fields are referenced.
all help is much apreaciated
Thanks
View Replies !
View Related
Asp Database Field Loaded Into Dynamic Text Field -HELP
Hi all,
after much trial and error and still having troubles i thought i would ask people that maybe know what there doing.
Im using Flash 8 pro, and have placed textarea component on stage and gave it an instantce name, need to pull a single record from a record database using asp.
This is my approach but if there is an even easier way let me know.
I have created the following pages.
webpage.asp (end result web page that shows the text field to user)
script.asp( asp script that sends data back/forth to flash
i used the FlashVars param to pass a variable into the flash movie.
variable is named auto_num. im using this to then pass it back out of flash to filter the recordset.
then on the flash movie.swf. all on root level. i have the following code
var text_value; //(this is the value sent back from asp page string)
//not sure if i needed to declare it but did anyways.
var_sender = new LoadVars();
myData = new LoadVars();
var_sender.auto_number = auto_num //(auto_num is loaded flashvars param)
myData.onLoad = function() {
my_text_1.text = this.text_value
};
myData.sendAndLoad("http://www.********.com/script.asp", myData ,"POST");
on the script page i have a record set that filters for form variable named auto_number. all of code is in asp. I call a response.write to write the text_value back to the flash movie.
here is the heart of the script.asp code. not showing the record set filtering stuff.
<% Dim text_value
text_value = "text_value="&(Recordset1.Fields.Item("long_des"). Value)
response.write(text_value)
%>
but i get undefined and can never get the variables to load into the flash movie. i want to export as flash player 6 or 7. what am i doing wrong here?
So in a nutshell, i have an asp page that shows a record and would like to display the long description field of that record in a flash dynamic text box.
I can make it work by passing the entire long description from record set within the flashvars param but that seems like a real clunky way to do it pasing that much text within the flashvars param.
Does anyone know of simple database connectivity kits that extend flash for the semi-programmer guys?
View Replies !
View Related
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
View Replies !
View Related
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!
View Replies !
View Related
How To Stop Text Floating To Right Side Of An Image Inside A Dynamic Text Field
Hi
I have dynamic text field that loads in a txt file containing
html formatted text including an embedded image.
When I test the movie the text that should appear bellow
the image, instead, runs down the right side of the image.
I have tried adding various html attributes including -
Code:
<br clear="all"><img src="image.gif" /><br >
I have also tried attaching a style sheet and appying the
following class -
Code:
img.allClear {
clear: all;
}
and also redefining the image tag -
Code:
img {
clear: all;
}
None of witch have worked.
Can someone help with this please.
Regards Mydogmax
View Replies !
View Related
Long Text Doesn't Fit Inside Single-line Input Text Field
Hi, I've been browsing these forums for a long time but this is my first post.
I'm creating an interface by which a user can design and order their own customized decal. Please see my example (I've added my script at the bottom of this post):
http://www3.sympatico.ca/sin.young/decaldesigner.html
My issues are:
1. I've set the character limit to 21, but if you were to type in 21 "W"s into the input field for whatever reason, or choose a wider font, the text shifts to the left and some of the characters become hidden as they don't all fit. I'd like to make the width of the text to always fit inside of the width of the white area. I can't figure out how to make this work.
Here's an example that does pretty much what I'm trying to describe: www.stickerjunkie.com.
2. I have the Standard Colors combo box working perfectly but can't seem to get the Fonts combo box working.
Any hints or links to actionscript tutorials/help that might be useful to my predicament is extremely appreciated.
// display colors and formatting
decalColor = new Color(decal);
color1 = new Color(decalColor);
//
function changeColor(comp) {
decalColor.setRGB(comp.getSelectedItem().data);
}
//Standard Colors array
standardcolors = [{label:'STANDARD COLORS'},
{label:'White', data:0xffffff},
{label:'Black', data:0x000000},
{label:'Silver', data:0x9c9c9c},
{label:'Gray', data:0x636b73}];
collistStandard.setDataProvider(standardcolors);
collistStandard.setSelectedIndex(0);
collistStandard.setChangeHandler('changeColor');
//
//Fonts array
myfonts = [{label:'FONTS'},
{label:'Arial', data:'Arial'},
{label:'Serpentine', data:'Serpentine'},
{label:'Enviro', data:'Enviro'},
{label:'Forte', data:'Forte'}];
fontlist.setDataProvider(myfonts);
fontlist.setSelectedIndex(0);
fontlist.setChangeHandler('');
View Replies !
View Related
Changing Text Inside A Text Field, Bold/Italic/Underline Ect ...
Is it possible to change the appearance of text inside a text field, like say to bold, italic, underline, color and even a type of font if need be ... ?
Example:
Like say you have text field, and you have some option buttons, (bold/italic/underline/color/type-of-font) that when clicked on will dynamicaly change the text/font appearance in the text field.
Any tutorials on this matter, anyone know ?
View Replies !
View Related
Loading A Html-tagged Text File Into A Text Field...it's Just Not Working For Me...
hi,
i'm trying to load news.txt into a textfield using loadvars.
news.txt:
-----------------------------------
&news=<p font face="Verdana" size="12"><b>Recent Achievements:</b><br>Congratula etc. etc.
the as:
----------------------------------
loadnews = new LoadVars();
loadnews.load("flash/news.txt");
loadnews.onLoad = function(success) {
newstext = loadnews.news;
trace(newstext);
gotoAndStop(2);
}
the trace is showing that newstext is the text out of news.txt ... in the frame 2 that the onLoad function refers to is a textfield (multiline, with the html as true) which is supposed to display the newstext variable.
If i set newstext to something else ... eg: newstext = "some text" then it works fine ...
what's going on???
Cheers,
Ben
View Replies !
View Related
Button Function - Load Text File To Dynamic Text Field
Hey again,
okay straight into it. I have a few button named b1 b2 b3 and so on. Now these buttons i want to load a text file into a dynamic text field called myText. Now the text files which will be loaded contain html tags, so i want to have that property set.
Now current I have home.text loading into myText automically on swf loading. But when I click any of the buttons the text file won't change over.
Now my menu is seperate to the body. I have 3 swf files, one called base.swf, nav.swf and body.swf. Base.swf loads nav and body onto it.
here is what i have as the script.
Frame1 - body.swf
_root.onData = function(){
myText.html = true;
myText.htmltext = _root.myInfo;
}
loadVariables("home.txt", _root);
loadMovie("scratchy.swf", logo);
Frame1 - nav.swf - gigsbut (button)
on (release) {
loadVariables("gigs.txt", _root.body);
}
can anyone help point out where I am going wrong. I have a feeling I am not targeting the text field right from the button. If you could help point me in the right direction rather then give me the answer that would be good as I would learn better from that. Thanks
Wolfie
PS - Let me know if you want or need more info. Am happy to post it up.
View Replies !
View Related
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?
View Replies !
View Related
Dynamic Text Field Loads Text, Font Not Showing Properly
I have a flash 8 movie in which there is a dynamic text field loading data from the server. The data loads beautifully and appears in a text field formatted as html.
This html-formatted text field uses a stylesheet as well which works great for everything except the font. Using Flash, I have specified a font of DIN-Medium for the dynamic text box on my stage and yet the text that appears when I publish to my hosting provider appears to be Times New Roman. WTF?
My stylesheet does not specify any font family.
Can anyone tell me how I might get the dynamic text box to show the text using the DIN font? Do I need to export the font in the library of my flash movie or something?
Here's my actionscript:
PHP Code:
stop();
import TextField.StyleSheet;
var myStyleSheet:StyleSheet = new StyleSheet();
myStyleSheet.onLoad = function(success:Boolean) {
if (success) {
// trace("Styles loaded:");
} else {
// trace("Error loading CSS");
}
};
myStyleSheet.load("styles.css");
txtFilmNews.html = true;
txtFilmNews.styleSheet = myStyleSheet;
txtFilmNews.width = 295;
txtFilmNews.autoSize = true;
txtFilmNews.selectable = false;
var lvFilmNews:LoadVars = new LoadVars();
lvFilmNews.onLoad = function(success) {
if (success) {
txtFilmNews.htmlText = lvFilmNews.html;
} else {
trace('load failure!');
}
}
lvFilmNews.load('getHTML.php?q=filmNews');
Here is my stylesheet:
Code:
p {
color: #53301A;
font-size: 12px;
margin-bottom: 0px;
padding-bottom: 0px;
border:none;
}
.title {
font-size: 15px;
text-transform: uppercase;
color: #D06F1A;
font-weight:bold;
}
a {
color: #D06F1A;
font-weight:bold;
}
a:hover {
color: #53301A;
}
View Replies !
View Related
Resizing Dynamic Text Field & Maintaining Text Font Properties
I have created a dynamic text field and have specified the height and width in the property inspector. The font is set at Verdana, 12, multiline. After searching these forums I also clicked the Character button and set it to embed font outlines for all characters.
My problem is that when I try to type or paste text into the field it is stretched to fit the field dimensions. I just want to preserve the Verdana 12.
Any help is greatly appreciated.
View Replies !
View Related
Dynamic Text Field Loads Text, Font Not Showing Properly
I have a flash 8 movie in which there is a dynamic text field loading data from the server. The data loads beautifully and appears in a text field formatted as html.
This html-formatted text field uses a stylesheet as well which works great for everything except the font. Using Flash, I have specified a font of DIN-Medium for the dynamic text box on my stage and yet the text that appears when I publish to my hosting provider appears to be Times New Roman. WTF?
My stylesheet does not specify any font family.
Can anyone tell me how I might get the dynamic text box to show the text using the DIN font? Do I need to export the font in the library of my flash movie or something?
Attach Code
//Here's my actionscript:
stop();
import TextField.StyleSheet;
var myStyleSheet:StyleSheet = new StyleSheet();
myStyleSheet.onLoad = function(success:Boolean) {
if (success) {
// trace("Styles loaded:");
} else {
// trace("Error loading CSS");
}
};
myStyleSheet.load("styles.css");
txtFilmNews.html = true;
txtFilmNews.styleSheet = myStyleSheet;
txtFilmNews.width = 295;
txtFilmNews.autoSize = true;
txtFilmNews.selectable = false;
var lvFilmNews:LoadVars = new LoadVars();
lvFilmNews.onLoad = function(success) {
if (success) {
txtFilmNews.htmlText = lvFilmNews.html;
} else {
trace('load failure!');
}
}
lvFilmNews.load('getHTML.php?q=filmNews');
//Here is my stylesheet:
p {
color: #53301A;
font-size: 12px;
margin-bottom: 0px;
padding-bottom: 0px;
border:none;
}
.title {
font-size: 15px;
text-transform: uppercase;
color: #D06F1A;
font-weight:bold;
}
a {
color: #D06F1A;
font-weight:bold;
}
a:hover {
color: #53301A;
}
View Replies !
View Related
Help With Dynamic Text Field Being Populated From A Button On Same Stage Using Text Files...
I am using the following code:
var ImportsText = "Imports";
Imports.addEventListener(MouseEvent.CLICK,doClick);
function doClick(evt:MouseEvent):void {
List.text = ImportsText;
}
This will generate the word Imports on my List.text dynamic text field.
I have a list of 30 things that need to go in the place of the word imports, one each per line.
Is there a way for me to create a text file and load it instead?
So I have button1 which loads the text from the text file text1.txt and puts it in Last.text
and so button2 loads the text from the text file text2.txt and it is put in last.text
and so on.
Would like the text files to be able to have some formating that is translated to the Last.text
I am very new to AS3.0 so please bar with me. I think I am almost understanding what I need to do but I need a push in the right direction.
Thanks allot in advance.
Tamer Z
View Replies !
View Related
Dynamic Text Field: Swap Text With Diff Variable In Same Ext. File
I'm using the recommended
Code:
loadText = new LoadVars();
loadText.load(_global.text_url2);
loadText.onLoad = function(success) {
if(success){}
etc..
which is working well. I just want to attach an action to buttons which will switch the text for different variables in the same text file, in a single text box named archivetitle.
ie.
Code:
archivetitle.text = this.title1;
when button one is pressed
Code:
archivetitle.text = this.title2;
when button two is pressed.
Basically, how do i access an already loaded text object to refresh to a new variable? Thanks!
View Replies !
View Related
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
View Replies !
View Related
Dynamic Text Field: Swap Text With Diff Variable In Same Ext. File
I'm using the recommended
Code:
loadText = new LoadVars();
loadText.load(_global.text_url2);
loadText.onLoad = function(success) {
if(success){}
etc..
which is working well. I just want to attach an action to buttons which will switch the text for different variables in the same text file, in a single text box named archivetitle.
ie.
Code:
archivetitle.text = this.title1;
when button one is pressed
Code:
archivetitle.text = this.title2;
when button two is pressed.
Basically, how do i access an already loaded text object to refresh to a new variable? Thanks!
View Replies !
View Related
Save My Swf App's Text Field To A Text File Or Open It In A Browser Window
How would I go about creating a button in my flash application (swf) to simply save the contents of a single text field (plain text) to a text file in the location of the user's choice?
Or, even better, could I have it open up in a new browser window?
Also, is there an easy way to print that same text field--nothing else, just the text. This actionscripting is still hard to grasp. I'm not having any luck making the print dialog even show up. Here's my script:
printpage_btn.onRelease = function(){
var my_pj = new PrintJob();
var myResult = printJob.start();
if(myResult){
myResult = my_pj.addPage ("AminoAcids_txt", {xMin: 0, xMax: 540, yMin: 0, yMax: 720});
myResult = my_pj.addPage ("AminoAcids_txt", {xMin: 0, xMax: 540, yMin: 720, yMax: 1440});
my_pj.send();
}
delete my_pj;
}
View Replies !
View Related
Select Text File From Dropdown List, Content To Show In Swf Dynamic Text Field
I have a php page where there is a form with a dropdown list of all text files in my site. The name of the dropdown is $filename.
The action script in my swf is this:
loadVariablesNum("<?PHP echo $filename; ?>", 0);
but I get nothing. It displays correctly when I replace
<?PHP echo $filename; ?> with the actual value of $filename, for example:
loadVariablesNum("ui_websites.txt", 0);
Any ideas what I'm doing wrong?
View Replies !
View Related
Loading External Text File Into Flash Using Links From Dynamic Text Field Link?
I am using a dynamic text field to load in .txt files with html tags. I have a couple "click here" type links that I would like to use to load a different .txt document into the same dynamic text field instead of a url link like it does default. Is this possible? I'm sure I could put a button over the text since its not long enough to need a scrollbar but I would like a more dynamic and flexible way to do this if its possible.
Thanks
View Replies !
View Related
Resising A Dynamic Text Field Depending On The Amount Of Text...
Hi all...
I have a flash movie reading a xml file...
i m getting a list of questions and their respective answers...i d like to load those answers into a Mc that contains a dynamic text field ...
the question is:
how can i "resize" (add lines) my dynamic text field depending on the amout of text - i tried getting maxscroll and resizing but that only makes it bigger and doesnt add any additional lines like i d like it to...
thanx 4 ur help
View Replies !
View Related
Loss Of Text Formatting When Using Dynamic Text Field & Scroller
Hi all,
Using MX...
Another small problemo im having is when i format text in my dynamic text field and attch the scroller component to it, in preview mode i lose all the text format and it goes to the first text format it encounters and uses that for everything else in the dynamic text box.
Im not actually loading any text into the dynamic text box, im just using it with static text, so i can use the scroller component.(as i understand it, you can only attach the scroller component to a dynamic text box ??)
Why am i losing my text format AND is there a better way to have a scrolling text field when i just want to use static text...???
Thanks guys..hope thats not too confusing
Cheers
View Replies !
View Related
Linking External Text Files To Load Into A Text Field
hmmz.. i followed this tutorial.. http://www.flashkit.com/tutorials/In...40/index.shtml
Actionscript for Flash 5 dummies: Scrolling a text box II
so i manage to get everything to work so far minus the scroll bar which i omitted..
now i would like to be able to have different buttons to load different text files externally into the same text field..
what code shld i put for this buttons??
the movie clip of the textfield+scroller is called textbox
the textfield is called textbox2
the var of the textfield is called welcome
hope someone understands me..
View Replies !
View Related
|