'€' And '+' Won't Display In Dynamic Text Box
Hi, I'm using the actionscript below to retrieve text into a dynamic text box. I've also embedded a font that the dynamic text boxes are set to display entitled 'Codex LT' by adding it to my Library and changing the Linkage Properties to 'Export for ActionScript' and 'Export in first frame'.
All of this works brilliantly - the text is retrieved and is displayed as Codex LT even on computers that don't have the font installed. The only problem is that the dynamic text box refuses to display certain characters such as '+' and '€', even though it does display other similar characters such as '=' and '$'. Codex LT (see link) definitely does include the '+' and '€' characters. I even tried replacing Codex LT with Arial and the problem still remained.
I tried adding more glyphs via the Embed option in the dynamic text box's properties box but it has zero effect. I tried adding all the Latin characters, then I tried to add the '+' character via the 'Include these characters:' option and then I tried the 'All (39477) glyphs' option but after each attempt I published my movie and the '+' character failed to appear. I originally embedded the Codex LT font by importing it into my library and changing the 'Linkage properties', as when I tried to embed the font via the Embed option in the properties panel it didn't seem to embed the font at all.
Do you know how I can fix this?
Many thanks,
Leo
Code: path = "http://www.stpatrickscommunity.org/admin/text/landline.php"; // this should retrieve the text '+ 353 (0) 71 9620175' lv = new LoadVars(); lv.onLoad = function(){ str = unescape(this); str = str.split("=&onLoad=[type Function]").join(""); landline.html = true; // landline is instance name of textfield landline.htmlText = str; }; lv.load(path);
FlashKit > Flash Help > Flash ActionScript
Posted on: 09-11-2006, 08:37 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Dynamic HTML Text Fields Do Not Display Formatted Text?
Flashkit.com,
In Flash MX I am developing a lot of movies using dynamically populated html text fields. When the user does not have a font I used on their machine swapping happens on all dynamic and input fields. Only static fields display the corrent font. I make sure the text field properties are embedding the fonts. Still all of the dynamic html text fields do not display the formatted text. I have .fla samples I can email to anyone.
I have tried these macromedia solutions with NO success:
http://www.macromedia.com/support/fl...t_outlines.htm
http://www.macromedia.com/support/fl...namic_text.htm
http://www.macromedia.com/support/fl...haredfonts.htm
Does anyone have a working sample .fla they can send me?
-Jimmy
Dynamic HTML Text Fields Do Not Display Formatted Text?
Flashkit.com,
In Flash MX I am developing a lot of movies using dynamically populated html text fields. When the user does not have a font I used on their machine swapping happens on all dynamic and input fields. Only static fields display the corrent font. I make sure the text field properties are embedding the fonts. Still all of the dynamic html text fields do not display the formatted text. I have .fla samples I can email to anyone.
I have tried these macromedia solutions with NO success:
http://www.macromedia.com/support/fl...t_outlines.htm
http://www.macromedia.com/support/fl...namic_text.htm
http://www.macromedia.com/support/fl...haredfonts.htm
Does anyone have a working sample .fla they can send me?
-Jimmy
Dynamic Text File Doesn't Display All Of The Text HELP
Hi everyone, I have a flash site that I created for a church, and on the homepage my client wanted to have a section called Announcements, where she could easily update the text from that section. To accomplish this, I went to the Kirupa tutorials for dynamic text files in Flash.
I used the XML (or was it PHP) code, pasted it in my Flash movie, opened up Notepad to create my text file, and began inserting paragraphs of text in the Notepad. I attached a scrollbar to the dynamic text file since I wanted to see all of the paragraphs. Scrolled down to the bottom, and then quite surprisingly the rest of the paragraphs were cut off!
The website I'm working on is www.jonesumc.org, and the Announcements section and scrollbar are on the bottom left side of the homepage. The paragraph cut off was originally supposed to say:
FINANCIAL LITERACY BOOT CAMP The Financial Literacy Boot Camp for ages 5 - 18 will be held July 10th - 14th here at Jones. Applications are available today! Three levels offered, Elementary, Jr. High & High School. Our mission to “Expose & Empower” our children & youth to positive financial tools. Volunteers are needed for the week. See Hilary Byrde for more details.
Instead, the scrollbar and textbox cuts the paragraph to the word "Jr. High"
Does anyone know what the problem is?
This is the code inside Flash that allows the text file to communicate with the dynamic text box:
Code:
loadText = new LoadVars();
loadText.load("announcement1.txt");
loadText.onLoad = function() {
announce1.text = this.announce1;
};
The dynamic text box has an instance name of announce1, and the Var is labeled: announce1
The dynamic text box doesn't have any actionscript applied to it. The line type of this box is also Multiline, and the text wraps inside the box.
Inside Notepad, at the very beginning I was told to type "announce1="
Immediately after the equal sign, I could write any kind of text I wanted to. Instead of hitting the ENTER key I pressed the SPACEBAR key several times until I created a new line of text.
As for the code, that's it! There wasn't really anything complicated with the code and putting things together. In order to fully understand my problem I recommend taking a look at kirupa's tutorial for dynamic text. Thanks for your help!
Dynamic Text Won't Display
I just started using ASP with flash. I've gotten numbers in a Access table back into flash, but can't get text to display in a dynamic text box. I'm looping to give it plenty of time to load, but still won't work. Here's the ASP code which works for numbers.
<%@LANGUAGE="VBSCRIPT" %>
<%
Option Explicit
Dim Conn, fldName, fldEmail, fldMessage, fldDate, fldAddress, fldPhone, fldVillage, strsql, strname, stremail, strmessage, strdate, strphone, straddress, strvillage
Set Conn=Server.CreateObject("ADODB.Connection")
Conn.Open("contactus")
strsql="SELECT fldName, fldAddress, fldEmail, fldPhone, fldVillage, fldMessage, fldDate FROM tblGuestBook"
Set rsRecords = Conn.Execute(strsql)
strname = rsRecords("fldName")
straddress = rsRecords("fldAddress")
stremail = rsRecords("fldEmail")
strphone = rsRecords("fldPhone")
strvillage = rsRecords("fldVillage")
strmessage = rsRecords("fldMessage")
strdate = rsRecords("fldDate")
response.write"&fldName" & "=" & strname
response.write"&fldAddress" & "=" & straddress
response.write"&fldEmail" & "=" & stremail
response.write"&fldPhone" & "=" & strphone
response.write"&fldVillage" & "=" & strvillage
response.write"&fldMessage" & "=" & strmessage
response.write"&fldDate" & "=" & strdate
response.flush
Why won't a dynamic text box with a variable name fldName display the value in my Access table? I've tried so much I feel it may be something simple like there is a difference between numbers and strings in the code which I'm unaware of. By the way in Flash I'm looping around
loadVariables ("search.asp", "", "POST"); with an if statement of if fldName = Joe goto next frame.
Thanks
Can't Get Dynamic Text To Display
I have 4 instances of a smart clip on the same timeline with different names. The one variable being set is the location of the text file I'm importing text from. 4 simple buttons are used to navigate the site. The buttons send the curser, if you will, to the frame that has the appropriate instance of the clip. The clip is a container for a scrolling text box. The dynamic text field is named "text" and the one variable being set in each of the text files is named "text". The output window shows this:
Level #0:
Variable _level0.$version = "WIN 5,0,30,0"
Variable _level0.text = "start • This is some sample text. • end"
Movie Clip: Target="_level0.instance1.SkillsBox"
Variable _level0.instance1.SkillsBox.textFile = "html/skills.txt"
This is the statement to load the text:
loadVariablesNum(eval ("textFile"), 0);
VERY new to Flash so any help is appreciated. Thanks in advance!
Dynamic Text Display Bug?
I'm reading a .txt file to populate a dynamic text field in my Flash MX program. An example of the text I'm pulling in is:
&Menu=Line1
Line2
Line3
Line4
Line5 . . . and so on.
For appearance I've entered a -7 for Line Spacing in the Format Options box. This vertical spacing looks good when I test my movie.
The problem comes when I run the .swf file from my UNIX based ISP. The text displays but is compressed in the vertical (lines laying over each other).
Has anyone else noticed a similar problem or have a solution? Thanks for any help!
Dynamic Text Won't Display.
For some reason when I view my web page www.angelfire.com/creep/booger at my school, it won't display any of the text, but as you might be able to see it works everywhere else! Does anyone know what the deal is?
Dynamic Text Won't Display
Anyone have any guess as to why this is happening:
I have a dynamic text field with the font set to _sans.
I'm using the text to display preload progress. Works fine locally but the text won't show up when the site is on the web server.
I've checked everything over and over...
the text field has a variable name, etc. etc.
What's weird is that it works when I test it using "show streaming" but it doesn't work live.
Dynamic Text Display
Hi,
Wanna display value of variable through external text file. Its omitting + sign while displaying text.
Any solution ?
How To Display In A Dynamic Text Box
myXML = new XML();
myXML.ignoreWhite = true;
function parseXML(success) {
if (success) {
baseNode = this.firstChild;
myLength = baseNode.childNodes.length;
var i = 0;
myContent = new Array();
while (i < myLength) {
contentPush = new Array();
myYear = baseNode.childNodes[i].childNodes[0].firstChild.nodeValue;
contentPush["myYear"] = myYear;
myContent.push(contentPush);
delete contentPush;
i++;
}
}
}
myXML.onLoad = parseXML;
myXML.load("timeline.xml");
In the above code I can trace the "myYear" values, I want to display those values in a dynamic text box in the stage, I tried with "mytextbox.text=myYear;" but it shows undefined, how to do this
need help
thanks
ravi
How To Display In A Dynamic Text Box
myXML = new XML();
myXML.ignoreWhite = true;
function parseXML(success) {
if (success) {
baseNode = this.firstChild;
myLength = baseNode.childNodes.length;
var i = 0;
myContent = new Array();
while (i < myLength) {
contentPush = new Array();
myYear = baseNode.childNodes[i].childNodes[0].firstChild.nodeValue;
myContent.push(contentPush);
delete contentPush;
i++;
}
}
}
myXML.onLoad = parseXML;
myXML.load("timeline.xml");
I have a code above, I can trace "myYear" values, I want to display those values in a dynamic text box on the stage... how to do that?? need help
Dynamic Text Display On An SWF
I have a SWF that displays a stock ticker's price.
The price and ID of that stock are inside a MYSQL table. Now, I pass the SWF a flashvar of the stock's ID and I want the dynamic text to display the corresponding price.
I know how to pull the price into the actionscript via xml. But displaying the text is done how?
I've seen examples where they display data in a list like:
List_variable.dataProvider = data_provider;
Where data_provider is an array you populate from the xml.
But is there a way to do this with a single object? A list component is a bit inefficient for this, it's just the only example code I can find.
What component would you use and are there example codes to simply place dynamic text on it?
Thanks a bunch
Display Dynamic Text From ID?
I have an XML file setup to display the ID and text, and different text is associated with each ID. My problem is I can't figure out how to adjust my actionscript to allow me to designate the ID (in the code) and have it display the text associated with that ID in the movie/textfield.
Here's what my XML file looks like:
Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<ROOT>
<news ID="1" URL="IndexPic01.jpg" >
<body><![CDATA[Some text in here... yada yada yada bla bla bla]]></body>
</news>
<news ID="2" URL="IndexPic02.jpg" >
<body><![CDATA[More text in here... yada yada yada bla bla bla]]></body>
</news>
<news ID="3" URL="IndexPic03.jpg" >
<body><![CDATA[Some more text in here... yada yada yada bla bla bla]]></body>
</news>
<news ID="4" URL="IndexPic04.jpg" >
<body><![CDATA[Yet more text in here... yada yada yada bla bla bla]]></body>
</news>
</ROOT>
And here's the actionscript I've pasted together that I'm trying to use. This is displaying text in the dynamic textbox...but it's always from the last entry (which is the 4th) and I don't know how to make it use the others manually.
Code:
theNews = new XML();
theNews.ignoreWhite = true;
theNews.load('admin/IndexImage/xml.php'+"?cK="+random(9999)+1);
function Article( ID, body){
this.ID = ID;
this.body = body;
};
Article.prototype.putOut = function(bodytxt){
if (this.body == undefined){
this.body = "Loading...";
}
movieTxt.bodytxt.htmlText = this.body;
};
function articleOut(xml){
_global.numArts = xml.firstChild.childNodes.length-1;
info = xml.firstChild.childNodes[at].attributes;
body = xml.firstChild.childNodes[at].firstChild.firstChild.nodeValue;
// trace(body);
body = body.split("
").join("
");
body = body.split("<strong>").join("<b>");
body = body.split("</strong>").join("</b>");
body = body.split("<em>").join("<i>");
body = body.split("</em>").join("</i>");
body = body.split("</p>").join("</p><br>");
body = body.split('size="3"').join('size="12"');
body = body.split('size="4"').join('size="13"');
body = body.split('size="5"').join('size="14"');
body = body.split('size="6"').join('size="15"');
body = body.split('size="7"').join('size="16"');
body = body.split("<div").join("<p");
body = body.split("</div>").join("</p>");
body = body.split("·").join("·");
body = body.split("…").join("…");
body = body.split("“").join(""");
body = body.split("”").join(""");
body = body.split("’").join("'");
body = body.split("–").join("-");
body = body.split("„").join(""");
// trace(body);
currArticle = new Article(info.ID, body);
currArticle.putOut("bodytxt");
delete currArticle;
delete info;
}
trace(_root._width);
theNews.onLoad = function(){
articleOut(this);
at = numArts;
articleOut(this);
}
articleOut(theNews);
Dynamic Text Won't Display
I don't know if this is a bug. I have a movie that contains a dynamic text. When I run it, the text displays fine. But when the said movie is run through another movie clip (using loadMovie), the dynamic text won't display. Any ideas why? Thank you.
Edited: 10/24/2006 at 12:29:50 AM by dongzky
Can't Display Dynamic Text
I do the same thing as it is shown in the tutorial but still the dynamic text area is empty when I run the page.
I will write the things step by step so you may tell me about the problem
I open my flash5
I create a new empty text area
I switch to dynamic text
Single line is sleceted
I select HTML and Border/Bg
I enter test as a variable name
Then I select the text area and convert it to a movie clip symbol
Then I right click on the symbol and click actions
I add the actions and the line looks like this
onClipEvent (load) {
loadVariables ("http://localhost/test.php", "this", "GET");
}
Then I create the php file which looks exactly like this
<?php
$x = "abc";
print $x;
print "test=$x";
?>
Then I click publish in flash, it generates the files and when I goto http://localhost/test.html I see the text area I created but it is empty.
I am nearly going mad I couldn't find what is wrong, someone pls help me
Thanks
Dynamic Text Display
Another problem by me, I'm trying to display external text via CSS in the Impact font but for some reason everytime I preview my .fla file the Impact text looks horrible. I put some Impact text static on the page and it looked find and when I changed that to Dynamic that altered itself to the horrible text! Why is it doing this?
Frustration or what!
Lewn
Dynamic Text Display
Hey I have this problem with dynamic text... this code is located inside 2movie clips...
scene1 -> MovieHolder -> MovieAboutText
Whenever i "Test scene" and im inside the MovieAboutText the dynamic text is located from the www.address... and displayed in the dynamic text box (Works Fine)
however...
Unfortuately whenever I click "Test Movie" the dynamic text fails to load... im not sure why this would work while you are inside the actual movie but not 2levels about...
Here is my dynamic text code within the MovieAboutText:
var format = new TextField.StyleSheet();
var path = "http://www.asmithphotography.co.uk/a...style_main.css";
format.load(path);
format.onLoad = function(success) {
if (success) {
inText.styleSheet = format;
myLoadVar = new LoadVars ();
myLoadVar.load("http://www.asmithphotography.co.uk/a...aphy_about.txt")
myLoadVar.onLoad = function (success){
if (success == true) {
inText.variable = "asmithphotography_textdata"
inText.htmlText= myLoadVar.asmithphotography_textdata;
loadText.onLoad = function() {
inText.text = this.asmithphotography_textdata;
}
}
}
} else {
inText.text = "Error loading CSS file!";
}
};
Thanks for looking...
How To Get Commas To Display In Dynamic Text > 999?
Just starting with actionscript, so I've just got basic code here.
reps, shows, and unitcost are variables for input text,
pressing button performs calculation to yield result into dynamic text variable annualcost...
However, how do you get the commas to display on numbers greater than 999?
The code on my calculate button reads:
-----------
on (release) {
annualcost = reps*shows*unitcost*12;
}
-----------
Thanks.
Display Value Of Array In Dynamic Text Box?
i have an array setup like so:
var mp3 = new Array();
mp3[0] = "myMP3";
when i try to set the variable in a dynamic text box to:
_root.mp3[0] nothing displays
is this possible?
if i do:
var text = "hello";
then set dynamic text box variable to _root.text it works fine and displays hello
please help
Dynamic Text Doesn't Display
hello,
i'm trying to load an external txt file into a dynamic text field inside a moiveclip. this works fine when i test the scene.
but when i place this movieclip on the stage and test the movie again on the main timeline. the text doesn't display.
is anyone can help me to solve this problem? or, it will really help if you have any sample file that can share with me.
thx!
Help With Dynamic Text Field Display
hi all,
i have a movie clip within my main timeline that is controlled by three buttons. each click on one of these three buttons, executes a script that loads data from an external text file into the above mentioned movie clip. the text loads correctly but my problem is this:
let's say the buttons are called "button one", "button two" and so on. if you click "button one" the appropriate text is loaded and displayed in the dynamic text field in the movie clip. however, if you click "button two" or "button three" it also loads the text but it appears ON TOP OF the text that was previously loaded in to the dynamic text field INSTEAD of replacing that previously loaded text.
how do I get the dynamically loaded text to appear in the text box and not have the previously loaded text still displayed? any help much appreciated.
thanks in advance,
cj
Dynamic Text Won't Display In External Swf
Hi,
I've been searching all over these and other forums for an answer to this question but can't find an answer that works.
I am loading an swf into an MC within another MC which will scroll which is in my Main movie.
Problem is that the dynamically loaded text (which shows fine in the original swf) won't show when loaded into all these other swfs.
Any ideas? I've tried embedding fonts (didn't work).
Your help is gretaly appreciated.
Jman
Dynamic Text Won't Display In External Swf
Hi there,
I posted this thread to newbies but haven't received much response. I thought maybe you guys would be more suited to help.
I've been searching all over these and other forums for an answer to this question but can't find an answer that works.
I am loading an swf into an MC within another MC which will scroll which is in my Main movie.
The swf that these boxes are in is duplicated several times in the it's parent movie and are scrollable from that movie. I would like to be able to load variables from several different text files for each duplicated movie.
Problem is that the dynamically loaded text (which shows fine in the original swf) won't show when loaded into all these other swfs.
I guess all I need to know is why dynamic text will show if it's on the main stage of a movie but not if it is then loaded as an external swf into a MC in the main movie.
If it helps I have uploaded the fla with the dynamic text boxes that needs to be loaded into the MC in the main movie.
Hope you guys can help.
Cheers,
Jman
Dynamic Random Display Text?
I was wondering if you could give this nub on how to read text from a file and display a random line. Id like to add a little random quote thing to some of my flash content but id also like it to read the text from a file.
So say your file is blah.txt, inside containing
Code:
Random Message Line 1
Random Message Line 2
Random Message Line 3
Random Message Line 4
Random Message Line 5
How could i go abouts doing that? the file would be in the same directory as the .swf file. Thanks for any pointers!
Desperate - Dynamic Text Display
I have a flash 4 movie that displays dynamic text in a button. It works sometimes, but sometimes it doesn't does anyone have any idea why it will work on some browsers and not others?
Display Number In Dynamic Text Box
Hey everyone,
I'm trying to display a total value in a dynamic text box but keep getting the value of NaN displayed.
Here is my code:
var totalScore:Number;
var No:Array = new Array(35);
for(var i = 0; i < 35; i++){
No[i] = 0;
}
for(var i = 0; i < 35; i++){
totalScore += No[i];
}
totalVal = totalScore;
trace(totalVal);
any help would be much appreciated
DoomedLung
[F8] Add Prices And Display In Dynamic Text Box
Hey,
I have a combobox and radio buttons with specific prices that I want attached depending on the choice the user makes. I'm having trouble getting the application to add the total of the selections and display the total in a dynamic textbox.
I am trying to use global variables. I set them to a certain value depending on what is selected. At the end I set add them up in the variable total and set that equal to the text box named totalPrice.
Right now the value of the global variables is not being returned from their functions.
Any suggestions for how to do this correctly? I have a link to the fla in a zip file. Below is the code if you'd rather just look at that.
Thanks!
Code:
//combo box
//create new listener to check for a change in combobox
objComboListener = new Object();
objComboListener.change = function(eventObj){
//create variable to get comboboxes label and check to see if it's "Please Select"
//get the data value of selected item and set global variable to a price
var number=sizeBox.getSelectedItem().data;
if(number==0){
_global.collarSize = 0;
return _global.collarSize;
} else if (number==1){
_global.collarSize = 10.00;
return _global.collarSize;
} else if (number==2){
_global.collarSize = 15.00;
return _global.collarSize;
} else if (number==3){
_global.collarSize = 20.00;
return _global.collarSize;
}
}
//call the change function
sizeBox.addEventListener("change", objComboListener);
//personalize yes or no
//create a new listening object and create a function for it
personListener = new Object();
personListener.click = function (evt){
//get the label for an item and set variables to a price
person = evt.target.selection.label;
if (person=="Side") {
_global.side = 7.00;
_global.center=0;
return _global.center;
return _global.side;
}else if (person=="Center") {
_global.side=0;
_global.center = 8.00;
return _global.center;
return _global.side;
}else {
_global.side=10;
_global.center=0;
return _global.center;
return _global.side;
}
}
//call the personalize function
Personalize.addEventListener("click", personListener);
//add the global variables and put them into total
_global.total = _global.collarSize + _global.center + _global.side;
//display results in dynamic text box next to "Price:"
price.totalPrice.text=_global.total;
[CS3] Display Integer In Dynamic Text Box
Very new to this, just been playing around with as3 trying to get a basic idea,
i have placed a dynamic text box on the stage and called it number_txt
have added this actionscript,
var x:int = 5;
number_txt.text = x;
with the thought that this would place a 5 in the text box but all i get is
"1067: Implicit coercion of a value of type int to an unrelated type String."
I realise that this is very very basic but what have i done wrong??
Display Number In Dynamic Text Box
Hey everyone,
I'm trying to display a total value in a dynamic text box but keep getting the value of NaN displayed.
Here is my code:
var totalScore:Number;
var No:Array = new Array(35);
for(var i = 0; i < 35; i++){
No[i] = 0;
}
for(var i = 0; i < 35; i++){
totalScore += No[i];
}
totalVal = totalScore;
trace(totalVal);
any help would be much appreciated
DoomedLung
Display Filename In Dynamic Text
Hey everyone. I need to find a way to display the file name of a _parent swf file in the dynamic text object of an embeded swf. Basically, I've created a feedback form in a seperate swf file that I embed into a parent swf file. I need the form to capture the filename of the parent swf before the form submits its data. Does anyone know of variable that will allow you to find out what the filename of an swf is? Any help is greatly appreciated. Thanks in advance.
[AS2] How To Display Array Value In Dynamic Text Box
Hey guys, Is it possible to display array values in a dynamic text box -- All created in As2? My problem is I need a dynamic text box that will load On button press, at the bottom left hand corner of images of various size. I got the positioning part down...but I cant seem to make it display what I have stored in an array -- namely 'text' from an xml attribute. is there a way to do this?
This is the text field in a movieclip. I acknowledge that the names are very dumb.
Code:
this.createEmptyMovieClip("wassup", this.getNextHighestDepth());
wassup.createEmptyMovieClip("buttonBkg", wassup.getNextHighestDepth());
wassup.buttonBkg.lineStyle(0, 0x000000, 0, true, "none", "square", "round");
wassup.buttonBkg.lineTo(120, 0);
wassup.buttonBkg.lineTo(120, 30);
wassup.buttonBkg.lineTo(0, 30);
wassup.buttonBkg.lineTo(0, 0);
wassup.buttonBkg.endFill();
wassup.buttonBkg.alpha(0);
var myFormat:TextFormat = new TextFormat();
myFormat.align = "center";
myFormat.font = "my_font";
myFormat.size = 16;
myFormat.color = 0x000000;
wassup.createTextField("closer", wassup.getNextHighestDepth(), 0, 5, wassup._width, 24);
//this is where I'm getting tripped up -- What do I point to? And where does wassup.closer.text go?
wassup.closer.text = "";
wassup.closer.embedFonts = true;
wassup.closer.selectable = false;
wassup.closer.antiAliasType = "advanced";
wassup.closer.setTextFormat(myFormat);
wassup.closer.autoSize = true;
this is the On Press function of a calendar template I got at FlashComponents. (yeah, boo me)
but really i just want to point out that the 'what' array is what I want...I 'push' it below the xml parsing. Ignore the 'area.txt' stuff as it is from the template and I'm afraid to get rid of it.
Code:
function didyoupressme(n:Number){
var currentSelected;
var movieClip:MovieClip = createEmptyMovieClip("movieClip", 0);
var where = new Array();
var what = new Array();
var linkname = new Array();
for (i=0;i<my_xml.firstChild.childNodes.length;i++){
if (my_xml.firstChild.childNodes[i].attributes.number == curentYear)
for (j=0;j<my_xml.firstChild.childNodes[i].childNodes.length;j++){
if (my_xml.firstChild.childNodes[i].childNodes[j].attributes.number== curentMonth)
for (k=0;k<my_xml.firstChild.childNodes[i].childNodes[j].childNodes.length;k++)
if (my_xml.firstChild.childNodes[i].childNodes[j].childNodes[k].attributes.number==n)
for (q=0;q<my_xml.firstChild.childNodes[i].childNodes[j].childNodes[k].childNodes.length;q++){
if ((my_xml.firstChild.childNodes[i].childNodes[j].childNodes[k].childNodes[q].attributes.txt!=undefined)
and (my_xml.firstChild.childNodes[i].childNodes[j].childNodes[k].childNodes[q].attributes.lnk!=undefined))
if (informationTextFont)
area.txt.htmlText+="<b><font color='"+informationTextLinkColor+"' size='"+informationTextSize+"'face='"+informationTextFont+"'><a href='"+my_xml.firstChild.childNodes[i].childNodes[j].childNodes[k].childNodes[q].attributes.lnk+"'>"+my_xml.firstChild.childNodes[i].childNodes[j].childNodes[k].childNodes[q].attributes.txt+"</a></font></b>";
else
area.txt.htmlText+="<font color='"+informationTextLinkColor+"' size='"+informationTextSize+"'face='"+informationTextFont+"'><a href='"+my_xml.firstChild.childNodes[i].childNodes[j].childNodes[k].childNodes[q].attributes.lnk+"'>"+my_xml.firstChild.childNodes[i].childNodes[j].childNodes[k].childNodes[q].attributes.txt+"</a></font>";
else if (my_xml.firstChild.childNodes[i].childNodes[j].childNodes[k].childNodes[q].attributes.txt!=undefined)
if (informationTextBold)
area.txt.htmlText+="<b><font color='"+informationTextColor+"' size='"+informationTextSize+"' face='"+informationTextFont+"'>"+my_xml.firstChild.childNodes[i].childNodes[j].childNodes[k].childNodes[q].attributes.txt+"</font></b>";
else
area.txt.htmlText+="<font color='"+informationTextColor+"' size='"+informationTextSize+"' face='"+informationTextFont+"'>"+my_xml.firstChild.childNodes[i].childNodes[j].childNodes[k].childNodes[q].attributes.txt+"</font>";
if (my_xml.firstChild.childNodes[i].childNodes[j].childNodes[k].childNodes[q].attributes.pic!=undefined){
ok=true;
var url = new String;
url = my_xml.firstChild.childNodes[i].childNodes[j].childNodes[k].childNodes[q].attributes.pic;
//trace (url);
var blurb = new String;
blurb = my_xml.firstChild.childNodes[i].childNodes[j].childNodes[k].childNodes[q].attributes.txt;
//trace (blurb);
var going = new String;
going = my_xml.firstChild.childNodes[i].childNodes[j].childNodes[k].childNodes[q].attributes.lnk;
//trace (going);
where.push(url);
what.push(blurb);
linkname.push(going);
var listenerObj:Object = new Object();
listenerObj.onLoadInit = function (target_mc:MovieClip):Void {
target_mc._x = (Stage.width / 2 - target_mc._width) / 2 + 850;
target_mc._y = (Stage.height / 2 - target_mc._height) / 2 + 175;
//trace("dimensions" +target_mc._width + target_mc._height);
var myDropShadowFilter = new DropShadowFilter (16,45,0x000000,.15,15,15,1.5,1,false,false,false);
target_mc.filters = [myDropShadowFilter];
var tw:Tween = new Tween(movieClip,"_alpha",Strong.easeIn,0,85,1,true);
myButton1._x = ((Stage.width / 2 - target_mc._width) / 2 + 850) + target_mc._width - 95;
myButton1._y = ((Stage.height / 2 - target_mc._height) / 2 + 175) + target_mc._height + 10;
wassup._x = ((Stage.width / 2 - target_mc._width) / 2 + 850) + target_mc._width - 95;
wassup._y = ((Stage.height / 2 - target_mc._height) / 2 + 175) + target_mc._height + 10;
currentSelected = "movieClip";
}
var movieClipLoader:MovieClipLoader = new MovieClipLoader();
movieClipLoader.addListener(listenerObj);
movieClipLoader.loadClip(url, movieClip);
myButton1.onRelease = function() {
getURL(going);
}
}
}
}
}
}
So basically as this stands -- I can load in the text field and position it where I want to. I stored information in an array that I can trace as valid. I just need to get that array text into the text field. Whether this is possible, or whether this is the best way -- very good questions which I can't seem to find answers to.
Please Help.
Help With Dynamic Text Field Display
hi all,
i have a movie clip within my main timeline that is controlled by three buttons. each click on one of these three buttons, executes a script that loads data from an external text file into the above mentioned movie clip. the text loads correctly but my problem is this:
let's say the buttons are called "button one", "button two" and so on. if you click "button one" the appropriate text is loaded and displayed in the dynamic text field in the movie clip. however, if you click "button two" or "button three" it also loads the text but it appears ON TOP OF the text that was previously loaded in to the dynamic text field INSTEAD of replacing that previously loaded text.
how do I get the dynamically loaded text to appear in the text box and not have the previously loaded text still displayed? any help much appreciated.
thanks in advance,
cj
Dynamic Text Display Problem Mac-PC
Hi, hope someone can help.
I have made a percentage loader in Flash on my Mac and tested it on the web. The dynamic percentage text looks how it was intended on a Mac but when I checked it on a PC, it looked completely different, bad. Is there any way of making them look the same.
Any advice is greatly appreciated.
Nested Dynamic Text Won't Display
Everything works correctly below. The new button displays on stage, but the nested dynamic text (instance name "campText") will not display.
1119: Access of possibly undefined property campText through a reference with static type flash.display:SimpleButton.
Here's the short code:
import flash.display.SimpleButton;
import flash.display.*;
import flash.text.TextField;
var myButton:SimpleButton = new camp();
myButton.x = 350;
myButton.y = 100;
myButton.campText.text = "CAMP";
addChild(myButton);
How To Display Dynamic Text On Mouseover
Hi, when I mouseOver my button, I want another symbol with dynamic text in it to appear almost like a speech bubble
I guess it would be something like this in the button:
onMouseOver display symbol1
But don't really know the specifc code, any help would be great!
Thanks
Jez
Add Prices And Display In Dynamic Text Box
Hey,
I have a combobox and radio buttons with specific prices that I want attached depending on the choice the user makes. I'm having trouble getting the application to add the total of the selections and display the total in a dynamic textbox.
I am trying to use global variables. I set them to a certain value depending on what is selected. At the end I set add them up in the variable total and set that equal to the text box named totalPrice.
Right now the value of the global variables is not being returned from their functions.
Any suggestions for how to do this correctly?
Thanks!
Attach Code
//combo box
//create new listener to check for a change in combobox
objComboListener = new Object();
objComboListener.change = function(eventObj){
//create variable to get comboboxes label and check to see if it's "Please Select"
//get the data value of selected item and set global variable to a price
var number=sizeBox.getSelectedItem().data;
if(number==0){
_global.collarSize = 0;
return _global.collarSize;
} else if (number==1){
_global.collarSize = 10.00;
return _global.collarSize;
} else if (number==2){
_global.collarSize = 15.00;
return _global.collarSize;
} else if (number==3){
_global.collarSize = 20.00;
return _global.collarSize;
}
}
//call the change function
sizeBox.addEventListener("change", objComboListener);
//personalize yes or no
//create a new listening object and create a function for it
personListener = new Object();
personListener.click = function (evt){
//get the label for an item and set variables to a price
person = evt.target.selection.label;
if (person=="Side") {
_global.side = 7.00;
_global.center=0;
return _global.center;
return _global.side;
}else if (person=="Center") {
_global.side=0;
_global.center = 8.00;
return _global.center;
return _global.side;
}else {
_global.side=10;
_global.center=0;
return _global.center;
return _global.side;
}
}
//call the personalize function
Personalize.addEventListener("click", personListener);
//add the global variables and put them into total
_global.total = _global.collarSize + _global.center + _global.side;
//display results in dynamic text box next to "Price:"
price.totalPrice.text=_global.total;
Edited: 02/12/2008 at 07:10:54 AM by jay0316
How To Justify XML Display In Dynamic Text Box?
Hello
I have an XML file which displays text in a dynamic text box (I have MX 2004) and although I have selected 'justify' in the Properties panel, the text is not justifying. What is the best way, please, of rectifying this?
Thanks.
Steve
Nested Dynamic Text Won't Display
Everything works correctly below. The new button displays on stage, but the nested dynamic text (instance name "campText") will not display.
1119: Access of possibly undefined property campText through a reference with static type flash.display:SimpleButton.
Here's the short code:
import flash.display.SimpleButton;
import flash.display.*;
import flash.text.TextField;
var myButton:SimpleButton = new camp();
myButton.x = 350;
myButton.y = 100;
myButton.campText.text = "CAMP";
addChild(myButton);
Display XML Inside Dynamic Text
Hi
i try to display data from the XML file inside dynamic text using this code :
Quote:
book_xml = new XML();
book_xml.ignoreWhite = true;
book_xml.onLoad = function(success) {
if (success) {
display_cont(book_xml);
_root.container.text = Result;
}
};
book_xml.load("xml.xml");
display_cont = function (Doc_xml) {
Result = new Array();
for (var n = 0; n<Doc_xml.firstChild.childNodes.length; n++) {
Result1 = [Doc_xml.firstChild.childNodes[n].firstChild.nodeValue];
Result.push(Result1);
}
};
for (i=0; i<Result.length; i++) {
Result = Result[i];
}
The output is :
Quote:
059600396X,ActionScript for Flash MX: The Definitive Guide, 2nd Edition,Book,null,19 December, 2002,O'Reilly & Associates,http://images.amazon.com/images/P/05...1.THUMBZZZ.jpg,
can i display it so each record come in new line ?
Quote:
059600396X
ActionScript for Flash MX: The Definitive Guide
2nd Edition
Book,
.
.
etc
check the attached zip file
ASP To Flash: Display Dynamic Text
Hello helpful Flash experts.
I'm a novice flash user (at best) and I'm using ASP to develop a webpage. One of my colleagues has designed a simple flash banner we're using on a website that only does the simple task of rotating images. Our employer has requested that we add text to the banner (I'll assume this can be done through code and a text-box in Flash) that updates from ASP code whenever new content is published on the website. For Flash, we only need the Title of the Event and the Date, which updates on our webpage through the database.
I know I may be lacking details in regards to database stuff, but I'm mainly an web editor dealing with front end stuff. I thought It may be easiest if I came here for advice first. We already have the code outputed on our website for the updated content, so the ASP code is there, I just need to plug it into the Flash file (in the text box) if that's at all easily possible.
If someone could kindly provide some advice or a good (simplified) tutorial, it would be appreciated.
Dynamic Text Multiline Display
Hey guys.
I am trying to make a dynamic text box in flash 8 that will display text that I create using a function. Like this.
Code:
function Messages(words:String) {
if (i<5) {
i++;
words = (_global.words) + i;
words = "";
}
talker.text = (_global.words1 + _global.words2 + _global.words3 + _global.words4 + words)
IDInterval = setInterval(resetTalker ,10000);
}
Maybe you can see what I'm trying to do from this?
In any case. I am trying to make a formula so that when you enter something like:
Code:
Messages("Hello World");
Messages("How are you?");
the text
Hello World
How are you?
will appear, on seperate lines.
Can anybody see what and how to do what I'm trying to do?
Thanks .
P.S. sorry if somebody has posted this, but i did search so ... =S
Add Prices And Display In Dynamic Text Box
Hey,
I have a combobox and radio buttons with specific prices that I want attached depending on the choice the user makes. I'm having trouble getting the application to add the total of the selections and display the total in a dynamic textbox.
I am trying to use global variables. I set them to a certain value depending on what is selected. At the end I set add them up in the variable total and set that equal to the text box named totalPrice.
Right now the value of the global variables is not being returned from their functions.
Any suggestions for how to do this correctly? I have attached the fla in a zip file. Below is the code if you'd rather just look at that.
Thanks!
Code:
//combo box
//create new listener to check for a change in combobox
objComboListener = new Object();
objComboListener.change = function(eventObj){
//create variable to get comboboxes label and check to see if it's "Please Select"
//get the data value of selected item and set global variable to a price
var number=sizeBox.getSelectedItem().data;
if(number==0){
_global.collarSize = 0;
return _global.collarSize;
} else if (number==1){
_global.collarSize = 10.00;
return _global.collarSize;
} else if (number==2){
_global.collarSize = 15.00;
return _global.collarSize;
} else if (number==3){
_global.collarSize = 20.00;
return _global.collarSize;
}
}
//call the change function
sizeBox.addEventListener("change", objComboListener);
//personalize yes or no
//create a new listening object and create a function for it
personListener = new Object();
personListener.click = function (evt){
//get the label for an item and set variables to a price
person = evt.target.selection.label;
if (person=="Side") {
_global.side = 7.00;
_global.center=0;
return _global.center;
return _global.side;
}else if (person=="Center") {
_global.side=0;
_global.center = 8.00;
return _global.center;
return _global.side;
}else {
_global.side=10;
_global.center=0;
return _global.center;
return _global.side;
}
}
//call the personalize function
Personalize.addEventListener("click", personListener);
//add the global variables and put them into total
_global.total = _global.collarSize + _global.center + _global.side;
//display results in dynamic text box next to "Price:"
price.totalPrice.text=_global.total;
How To Display " In Dynamic Text Box.
I want to display some random quotes in my website.Like this
"Someone said that something is something" - Someone.
So I need to display the character " .(quotation)
How to display it in dynamic text field?
Display Number In Dynamic Text Box
Hey everyone,
I'm trying to display a total value in a dynamic text box but keep getting the value of NaN displayed.
Here is my code:
var totalScore:Number;
var No:Array = new Array(35);
for(var i = 0; i < 35; i++){
No[i] = 0;
}
for(var i = 0; i < 35; i++){
totalScore += No[i];
}
totalVal = totalScore;
trace(totalVal);
any help would be much appreciated
DoomedLung
Display Dynamic Text In Columns
Does anyone know if this can be done and how to do it? I'm trying to take in a large string of text and split it into 2 columns (whether it's 1 text field instance or 2 text fields, it doesn't matter!) so that the text at the top of the second column continues where the text at the bottom of the first column left off.
I tried experimenting with character counting but it just wasn't accurate enough.
Any ideas?
|