Unexpected Text Results Using LoadVars?
Hi, The problem I am having is this. I am loading a text file into a loadVars object. I then use the variables of the object to send to a textArea component for the content of the web site. I have the component html set to true;
The results are this. The file displays creturns like a <br> ... Sometimes? Also if i use a <br> after <b> tags the line spacing works in some situations and not others. It is definately not acting like an html document. Spacing here and not here?... Is there a standard way to format txt files so that creturns aren't read? Any Help?
Thanks, Nate
DevShed > Flash Help
Posted on: December 6th, 2004, 02:49 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Unexpected Results
I'm not getting the results I expect with this code: var numPoints:uint = selectedPieces * selectedPieces * selectedPieces;
What I expect is selectedPieces^3 what I'm getting is (selectedPieces^2)^2
I.E. if selectedPieces = 3, I expect 3 * 3 * 3 = 27; I get (3*3)(3*3) = 81 why?
Unexpected Setpixel() Results
The problem that I am having is that I am expecting a perfectly diagonal line but this is not the case. **When however you zoom in the extra pixels disappear and it is drawn as expected** I actually had the problem when working on setting up a basic bresenham line drawing algorithm so wrote this to make the problem a lot clearer.
screen shot:
http://www.mediafire.com/?y2mg4bomglt
swf:
http://www.mediafire.com/?nmzm19xhht2
example code:
package {
import flash.display.*;
public class Rasterizer extends Sprite
{
public function Rasterizer()
{
var bmd:BitmapData = new BitmapData(200, 200, false, 0x000000);
for (var i:int = 0; i < 100; i++)
{
bmd.setPixel(i, i, 0xffffff);
}
var bm:Bitmap = new Bitmap(bmd);
addChild(bm);
}
}
}
Can someone please advice me of whats going on?
Keyboard <enter> Key Produces Unexpected Results
I develop a touchscreen UI for a C++ based kiosk application. It runs on a win2k system using at least flash player 6.
For data entry I utilize a custom onscreen keyboard. Everything has worked fine and been stable for nearly a year.
Recently we've been working towards delivering a desktop PC version of the product and need to enable keyboard text entry. For the most part this has gone pretty smoothly using a Key class listener. I can capture all letters, numbers, and most special characters.
The movie has two frames with a stop() action on the second one. Whenever the <Enter> key is pressed the movie jumps back to the first frame and all variables are re-initialized. I tried trapping the key with
if(Key.getCode() == Key.ENTER)
and also
if(Key.getAscii() == 13)
Neither seems to do the trick.
Although I originally wanted to capture the <Enter> key to use as a carriage return, I'd be satisfied now to simply disable it. I can successfully trap the <Tab> and <Down> keys to achieve the same result.
As i wrote this I checked a few other movies we use in the application and all of the multi-framed ones act the same way.
Is this a known behavior in the flash player? If so, what is the purpose?
I researched this topic on various forums and through Google to no avail.
For the record:
No, I'm not just testing this in the authoring environment. I've tested it in the kiosks.
The C++ developer has assured me that while the flash player has focus the C code does not handle any keyboard input.
Sorry for the length of the post, but I wanted to make sure I'd disclosed as much background info as I could.
Thanks in advance for any input anyone can offer me.
--Bob
Holding KeyPress Produces Unexpected Results
hey guys, first time posting here and a novice at actionscript. Basically im trying to build something like a carousel, but with using the keyboard arrow keys. If a user hits the left arrow key the tween method is fired should move to the next menu item and stop. MY PROBLEM is that when the key is HELD down, the switch which I apply to simulate the carousel effect, is either delayed or does not happen. This is not the case if they key is simply tapped... Please provide some info or even perhaps a different approach to this problem.. Thank you.
Attach Code
import mx.transitions.Tween;
var indexArray:Array = new Array();
indexArray[0] = "b1";
indexArray[1] = "b2";
indexArray[2] = "b3";
indexArray[3] = "b4";
indexArray[4] = "b5";
indexArray[5] = "b6";
indexArray[6] = "b7";
indexArray[7] = "b8";
indexArray[8] = "b9";
indexArray[9] = "b10";
indexArray[10] = "b11";
indexArray[11] = "b12";
function updateIndex(x:Number):Void {
var firstIndex:String = indexArray[0];
var lastIndex:String = indexArray[11];
var prev:String;
var current:String;
if (Key.getCode() == 39) {
for (i=0; i<12; i++) {
if (i == 0) {
current = indexArray[i];
indexArray[i] = lastIndex;
prev = current;
} else {
current = indexArray[i];
indexArray[i] = prev;
prev = current;
}
}
} else {
for (i=11; i>=0; i--) {
if (i == 11) {
current = indexArray[i];
indexArray[i] = firstIndex;
prev = current;
} else {
current = indexArray[i];
indexArray[i] = prev;
prev = current;
}
}
}
}
var centerX:Number = Stage.width/2;
var speed:Number = 0;
var beginX = -120;
var begin:Boolean = true;
for (var i = 1; i<13; i++) {
var t = this.attachMovie("button"+i, "b"+i, i+1);
t._x = beginX += 30;
t._y = 35;
}
var keyListener:Object = new Object();
keyListener.onKeyDown = function() {
switch (Key.getCode()) {
case 39 :
for (var i = 1; i<13; i++) {
var t = _root["b"+i];
myTween = new Tween(t, "_x", mx.transitions.easing.None.easeOut, t._x, t._x+30, 5, false);
if (Math.abs(t._x-centerX+30)<=14.7) {
t._xscale = 180;
t._yscale = 180;
t._alpha = 100;
} else {
t._xscale = 100;
t._yscale = 100;
t._alpha = 50;
}
}
myTween.onMotionFinished = function() {
trace(t._name);
var myFinish:Number = myTween.finish;
_root[indexArray[11]]._x = _root[indexArray[0]]._x-30;
updateIndex(39);
updateAfterEvent();
};
break;
case 37 :
var myTween:Tween;
for (var i = 1; i<13; i++) {
var t = _root["b"+i];
myTween = new Tween(t, "_x", mx.transitions.easing.None.easeOut, t._x, t._x-30, 5, false);
if (Math.abs(t._x-centerX-30)<=14.7) {
t._xscale = 180;
t._yscale = 180;
t._alpha = 100;
} else {
t._xscale = 100;
t._yscale = 100;
t._alpha = 50;
}
}
break;
}
};
keyListener.onKeyUp = function() {
switch (Key.getCode()) {
case 39 :
break;
case 37 :
begin = false;
break;
}
};
Key.addListener(keyListener);
Dynamic Masking Is Yeilding Unexpected Results.
Ok guys, here's my story.... I want to mask a movie clip that has dynamic text. Seems easy right? I follow the tutorial found here (http://www.kirupa.com/developer/mx2004/maskfonts.htm) and it sort of works.
I wind up with an SWF file that masks everything EXCEPT the dynamic text. So whether I want it there or not, the text is present. You can see an example here: http://www.scarboni.com/temp/about.html.
Basically, I just want to mask everything including the text until I'm ready to see it.... Any thoughts??? Thanks
LoadVars() To Display Multiple Results
Hi I am just wondering on how to display the multiple results into a flash file. The results are the from my sql query.
They are just the names and their scores.
Please please please please HELP
CHEERS
Need To Send ASP Results To Flash, Preferably Into Xml Results Packet?
I am creating a flash page that will pull images from a folder without specifying each image name. I have the script I need in ASP to get the image names from the folder but now I need to see this in flash. I have used the xml connector quite a bit and would be happy to just get the information back as an XML results packet. Of course if there is an easier way to do this I am open to suggestions.
Any help would be greatly appreciated.
Thanks,
Dave
Embedding Fonts Into HTML Enabled Text Area Component Results In No Text Appearing
I've tried this on both Flash's own text area component and Ghostwire's and have had exactly the same result with both.
Basically, I'm using the text area component to load in an HTML document. The component is supposed to display the Tahoma font but it isn't on all computers as Times might show up. So I went ahead and decided to embed the font. Doesn't matter if I place a dynamic text field off the stage and then select the embed fonts option or make a Font Symbol for Tahoma. If I tell the text area to embed fonts I then render out the .swf and the text disappears. Turn off HTML formatting and the text then appears but the formatting of course, is completely lost. Anyone got an idea of a real fix for this? Or at least an explanation?
Dynamic Text Results
i have 10 text boxes with scores between 0 and 100. i need to make a result page that only shows the scores with totals less than 50.
can somebody please help me.
tks
Input Text Testing And Getting Results
Hi. I'm just wondering if anyone can help me on the flash actionscript problem that I have recently. For example, I made a blank line, and in there, the word "apple" has to be typed. If the user type the spelling wrong and hit enter, it has to show on the side, "it's wrong". If the user type it right and hit enter, it has to show on the side that "it's right".
I can make this to work when there's only one line to be filled on the stage. However, I need to have about 10 lines on the stage to be filled, and each one contains different word to be filled. Anyone knows how to solve this problem?
Thanks to everyone who's trying to help me on this
Post Results To A Text File
First of all. I am new to actionscript.
I am developing a quiz game and would like to post the results to a text file on the local computer. Would appreciate any help.
Displaying Results In A Text Column
I'm developing a health questionnaire, where you answer a bunch of health-related questions, and are shown a bunch of health recommendations at the end.
After the user answers all 15 questions, I use a bunch of logic (if...then...else) to go through the answers and determine which result to show. Each question provides a specific recommendation. I then import the various recommendations as XML files. That all works fine.
Here's my problem. Each time I import an XML file, I'm trying to concatenate that content into a variable called "recommendations" and display it on the screen. Eventually, the recommendations should consist of a bunch of smaller recommendations pulled from each XML file.
Here's how I set up that field:
Code:
var ss:TextField.StyleSheet = new TextField.StyleSheet();
ss.load("kaiser_hra.css");
recommendations.styleSheet = ss;
recs = new XML();
recs.ignoreWhite = true;
// Formatting text field and importing content
recommendations.multiline = true;
recommendations.wordWrap = true;
recommendations.html = true;
recommendations._quality = "HIGH";
Then here's how I import each XML file and attempt to concatenate it:
Code:
add_content = function (chapter) {
chapterLoad = "recommendations/" + chapter + ".htm";
trace ("adding " + chapter);
recs.load(chapterLoad);
recs.onLoad = function() {
all_recs = all_recs + recs;
trace ("recs: " + recs);
trace ("all_recs: " + all_recs);
}
}
For the function above, I'm passing the variable "chapter" to determine which piece should load. I use the variable "chapterLoad" to set the file path and name of the actual file to load. Then I load the file into an XML object called "recs" which I defined earlier. All that works fine.
The problem comes when I try and concatenate the value of "recs" into a variable called "all_recs" which contains all the previous and subsequent values of "recs." In the trace command above, "all_recs" returns "NaN". Therefore, I think the problem revolves around this line:
Code:
all_recs = all_recs + recs;
Isn's this the correct way to concatenate a string variable? Let me know.
Dynamic Text In Form Results
Anyone know how do I include the dynamic text box data in a form? The user clicks on a picture when then populates a dynamic text field box with the text using external txt files. I then want the user to be able to email the form with some input fields filled out (which is working fine), but I cannot get the text from the dynamic fields to come through in the email. Thanks
Displaying Results In A Text Column
I'm developing a health questionnaire, where you answer a bunch of health-related questions, and are shown a bunch of health recommendations at the end.
After the user answers all 15 questions, I use a bunch of logic (if...then...else) to go through the answers and determine which result to show. Each question provides a specific recommendation. I then import the various recommendations as XML files. That all works fine.
Here's my problem. Each time I import an XML file, I'm trying to concatenate that content into a variable called "recommendations" and display it on the screen. Eventually, the recommendations should consist of a bunch of smaller recommendations pulled from each XML file.
Here's how I set up that field:
var ss:TextField.StyleSheet = new TextField.StyleSheet();
ss.load("kaiser_hra.css");
recommendations.styleSheet = ss;
recs = new XML();
recs.ignoreWhite = true;
// Formatting text field and importing content
recommendations.multiline = true;
recommendations.wordWrap = true;
recommendations.html = true;
recommendations._quality = "HIGH";
Then here's how I import each XML file and attempt to concatenate it:
add_content = function (chapter) {
chapterLoad = "recommendations/" + chapter + ".htm";
trace ("adding " + chapter);
recs.load(chapterLoad);
recs.onLoad = function() {
all_recs = all_recs + recs;
trace ("recs: " + recs);
trace ("all_recs: " + all_recs);
}
}
For the function above, I'm passing the variable "chapter" to determine which piece should load. I use the variable "chapterLoad" to set the file path and name of the actual file to load. Then I load the file into an XML object called "recs" which I defined earlier. All that works fine.
The problem comes when I try and concatenate the value of "recs" into a variable called "all_recs" which contains all the previous and subsequent values of "recs." In the trace command above, "all_recs" returns "NaN". Therefore, I think the problem revolves around this line:
all_recs = all_recs + recs;
Isn's this the correct way to concatenate a string variable? Let me know.
Dynamic Text In Form Results
Anyone know how do I include the dynamic text box data in a form? The user clicks on a picture when then populates a dynamic text field box with the text using external txt files. I then want the user to be able to email the form with some input fields filled out (which is working fine), but I cannot get the text from the dynamic fields to come through in the email. Thanks
Text Comments From Quiz Template Results
Hi! I created a quiz in Flash MX using the quiz template. In the results page, I want to add comments based on the results that the user got. Will that be possible in the quiz template?
I tried using an input text box with the variable "comment" and added the following code to the frame:
if (QuizTrack.percent_format<40) {
comment = "You may need to take the quiz again.";
} else if ((QuizTrack.percent_format>30) && (QuizTrack.percent_format<70)) {
comment = "You did okay";
} else if (QuizTrack.percent_format>70) {
comment = "Amazing!";
}
But this only displays the percentage result of the quiz (ex. 86%) in the comment text box. It does not show the additional text comment that I want to be included. Is there something wrong with my code? Can this be done in the quiz template? Please help!
[CS3] Dice Roller With Color Text Results
I am making a dice roller where you can roll multi dice at once...
I want the color of the text to show as certin color based on if the result is a success or not of the variable _root.Got (not the results as a whole). if it gets to the Roll again the roll is green, if it just a Success it blue, if none of them it's red (i know i will need to change it some if i want to putting in color depending on the results of each roll)
here is the code for the dice roller
PHP Code:
while (_root.Temp<_root.TotalRolls) {
_root.Got = random(9);
_root.Got = _root.Got+1;
_root.RollsGot = _root.RollsGot+_root.Got+", ";
if (_root.Got>=8) {
if (_root.Got>=_root.RollAgain) {
_root.Agains++;
_root.TotalRolls++;
}
_root.Success++;
}
_root.Temp = _root.Temp+1;
}
Evaluating Math And Outputting Results To A Text Box
Howdy, im new to flash (although, i only have access to flash 5 ) and was wondering how I evaulate math in action script and have the result print on screen somewhere like a text box? I dont want results in the output box, i want it contained within the movie
Thanks!
Inconsistent Results In Dynamic Text Quiz
Hello,
I'm getting inconsistent results in this dynamic text quiz. If you choose to go to the next question and then click "check" before you even drag the correct answer to the rectangle, it will sporadically give the answer. This doesn't happen every time, only randomly, and I can't figure out the reason. I've attached the fla.
The dynamic text for each question is called using a function and the simple i += 1 method of pulling from an array. The code to check the answer is on my check button. Maybe this is where the problem is?
Flash Remoting Displaying Results In Text Box
new to flashremoting built cfc to query database then want to display results in a text box based on testing tools results are being returned correctly but i cant figure out how to make them populate the text box.
I have a textbox with an instance name of getCheeks
querry returns two colums from database item and id
action script looks like this:
#include "NetDebug.as"
#include "NetServices.as"
#include "DataGlue.as"
// Create the gateway
if(isGatewayOpen == null) {
isGatewayOpen = true;
NetServices.setGatewayUrl("http://72.236.19.10/flashservices/gateway");
gw = NetServices.createGatewayConnection();
toolbarService = gw.getService("cfcSabre.LauraGeller.qToolbar",this );
trace("Connected");
// call web service sets
toolbarService.nCheeks();
}
// responder
function getnCheeks_results(){
DataGlue.bindFormatStrings(getCheeks, nCheeks, "#item#", "#id#");
}
Inconsistent Results In Dynamic Text Quiz
Hello,
I'm getting inconsistent results in this dynamic text quiz. If you choose to go to the next question and then click "check" before you even drag the correct answer to the rectangle, it will sporadically give the answer. This doesn't happen every time, only randomly, and I can't figure out the reason. I've attached the fla.
The dynamic text for each question is called using a function and the simple i += 1 method of pulling from an array. The code to check the answer is on my check button. Maybe this is where the problem is?
Dynamic Japanese Text Results In Mojibake
I have an xml file encoded utf-8 going into a dynamic text field in Flash MX. The xml file shows up the Japanese file no problem so it must be the swf that's misbehaving.
I've tried a few of the recommendations floating around - changing my computer into Japanese (using Mac OSX) and so on but still the Japanese characters still don't show up correctly.
Does anyone have any suggestions on tackling this? Or will I just need to embed the font (something I was trying to avoid)?
Cheers
gomichild
Calculate Results 0 View In Initail Text Field
I have created a simple calculation which gives a result in a var (dynamic text box). Before the input text field has any numbers keyed in to the field the dynamic text box (result) displays the character 0.
How do I create a dynamic text box that displays nothing or is empty before numbers are typed
ReplaceSel Results In Extra Space Preceding Text Replaced
Hi all - I'm working on a little app that allows the user to select a text segment in a dynamic/input field, and upon key press the selected text will change based on built-in parameters.
PROBLEM: Everything is working EXCEPT that when the text segment is replaced, an extra space is inserted before the new text segment.
Here's my code, which lives on Frame 1 and corresponds w/an input text field w/instance name 'myText':
____________________________
myText.addListener(myText);
//note to self: load textContent dynamically in next version
textContent = "This is the text I want to change. This is some other text. Leave this line alone. In this sentence, only select the following word: word."
myText.text=textContent
s = textContent;
_root.onMouseUp = function() {
x = Selection.getBeginIndex();
y = Selection.getEndIndex();
correctText = _level0.s.slice(_level0.x,_level0.y);
}
myText.onChanged = function() {
if ((correctText == "This is the text I want to change") || (correctText == "word")) {
newText = "text is changed";
myText.replaceSel( newText );
z = newText.length;
myTextFormat = new TextFormat();
myTextFormat.color = "0xff0000";
myText.setTextFormat(x, x+z+1, myTextFormat);
s = myText.text;
} else {
newText = correctText
myText.replaceSel( newText );
s = myText.text;
}
};
____________________________
Thanks in advance for any inspirations.
-Sarah
Help Loading Sorted Array Results Into Dynamic Text Fields
I am trying to load the results of an array and I can't figure it out. Basically what I am doing is sorting a list of 7 numbers from a "test", dropping the lowest 4, and keeping the top 3. I then need to identify the top three by the letter associated to that number, and have the results display in three seperate dynamic text fields.
.nt1 would be the total number of times that "A" was selected, .nt2 would be the total number of times that "B" was selected, etc.
//------here is the code that I am using
var score_array:Array = new Array();
score_array.push({score:_root.nt1, letter:"A"});
score_array.push({score:_root.nt2, letter:"B"});
score_array.push({score:_root.nt3, letter:"C"});
score_array.push({score:_root.nt4, letter:"D"});
score_array.push({score:_root.nt5, letter:"E"});
score_array.push({score:_root.nt6, letter:"F"});
score_array.push({score:_root.nt7, letter:"G"});
score_array.sortOn("score", Array.NUMERIC);
for (i=0; i<score_array.length; i++) {
trace(score_array[i].score+":"+score_array[i].letter);
}
var topThree_array:Array = new Array();
var topThree_array = score_array.splice(4);
for (i=0; i<topThree_array.length; i++) {
trace(topThree_array[i].letter);
}
//--------
when I test the script it works, and the results are accurate and show up in the output panel as exected:
0:E
0:F
2:A
6:D
6:C
6:B
8:G
C
B
G
When I am stumped is how to get the C, B, G to show up in their own text boxes as the sorted top 3 results. This is my first attempt at scripting this advanced...if anyone can help me that would be awesome, if you have a better way of getting the results - let me know - or if you can point me to a resource that will show me how to - that would rock.
Special Characters (input Text Fields) - Different Results From Keyboard
Hi all.
In my new website (not online yet) I'm using some input text fields in the contact form. The problem is, when you copy and paste a text with special characters (namely the ones used in Turkish) such as ğĞıİŞş they show up without any problem but when you input those characters using the keyboard, the result becomes ©½¦ˆßÍ. I thought that might be an issue with the font but I just purchased the OTF version of it (Georgia) from LinoType and I see that there's no problem with anything when pasted, or in any other application I used this font.
So I made a research and came up with System.capabilities.language returning en. I think this is what causes the problem but I'm not sure. Does anybody have an idea how I can correct this issue?
The encoding of html page is UTF-8, just in case.
Thanks in advance.
Dynamic Content: Cold Fusion Results Placed Into A Scrollable Text Field
I currently have a scrollable dynamic text field that is being populated from an externally located static text file.
This is the ActionScript that is currently in place; it is taken from the tutorial “Scrolling Dynamically Loaded Text” ( http://www.kirupa.com/developer/mx/dynamic_scroller.asp )
loadText = new loadVars();
loadText.load("StaticTextFile.txt");
loadText.onLoad = function() {
scroller.text = this.VariableName;
};
I need to utilize this scrollable dynamic text field functionality with information passed from Cold Fusion as opposed to a static text file.
I work closely with the Cold Fusion developers so they are confident that they can pass me just about anything I need. The problem is “we” don’t know what exactly that is.
Here is the scenario:
I am building a completely flash help module for one of their web projects. Throughout this module certain “glossary terms” are presented in various locations. When the user clicks one of the “glossary terms” (which have been made into buttons) I target a MC instance to come onto the stage and provide the definition.
You can see what I have built up onto this point here:
http://qc.accelerateu.org/joel/index.html
As it stands now the text for the definition is pulled in from a static text file. It needs to be dynamically generated from Cold Fusion and passed into my flash movie. The definitions for these glossary terms are located in a database as they are used in numerous projects/locations throughout our entire website.
What I need is:
I need a way to set a variable in flash that tells the movie what the source of the content is going to be. I need to pass that variable out of my movie to Cold Fusion then, based on the performed query, have the results sent back into my flash movie and be scrollable depending on the length of the content.
I don’t need to concern myself with anything transpiring on the Cold Fusion side, I just need to know how to send the query from my flash movie and put the results back in.
Any help would be tremendously appreciated! You could very well be saving my job :)
Have a great day,
jOEL
LoadVars With PHP And Text
Hello, I suck real bad at loadVars. I downloaded a script from a post earlier that works but I can't make my own...can someone help me? These are examples, how could I get the text fields to load what is in the text and PHP document? Please help??!?!?!
Loadvars (mainly A Text Box Problem)
Ok, I have used LoadVars to get a variable with my text from a .txt file in it.
However, I want to be able to use HTML in the text which is to be displayed in the box.
I have checked "HTML" in the text box properties...
BUT
When a text file which contains:
<i>(I've had to use { } instead of the < > to make sure the board doesn't interpret them as HTML... they are <> in the actual text file)</i>
{b}Hello{/b} and welcome to our site. We hope you enjoy the stay, this is {u}just{/u} a practice news entry, the others will be much more informative.
Is loaded in, I see:
%3Cb%3EHello%3C%2Fb%3E%20and%20welcome%20to%20our% 20site%2E%20We%20hope%20you%20enjoy%20the%20stay%2 C%20this%20is%20%3Cu%3Ejust%3C%2Fu%3E%20a%20practi ce%20news%20entry%2C%20the%20others%20will%20be%20 much%20more%20informative%2E=&onLoad=%5Btype%20Fun ction%5D
In the Flash Test movie area, and even when I open the .swf with my browser i get:
%3Cb%3EHello%3C%2Fb%3E%20and%20welcome%20to%20our% 20site%2E%20We%20hope%20you%20enjoy%20the%20stay%2 C%20this%20is%20%3Cu%3Ejust%3C%2Fu%3E%20a%20practi ce%20news%20entry%2C%20the%20others%20will%20be%20 much%20more%20informative%2E=&onLoad=%5Btype%20Fun ction%5D
Please help... I'm sure it's something silly that I have done... any further info needed feel free to contact me
Thanks
WP
Split Text From LoadVars
Hello all, I'm totally vexed and about to give up... I really hope somebody could help me out...
How do I load variables from an external file and then check its contents?
for example:
a)After loading the file which has this output
&message=This is a whole lot of text which has 160 characters. Please split these text into 40 sets each.
b)I then take the variable message and check for every 40 characters, split the text and put it into one movieclip each. Each movieclip is stacked one below another.
c)After all the text has been split and displayed, I will load the file again and do the same check again.
Can somebody please help me on how to go about doing these.
I really need help asap. Lots of appreciation to you dear helpers.
P.S: If you cannot understand what I am trying to do please tell me and I will explain again clearly.
Rgds,
huda
Dynamic Text And LoadVars
Hello! List,
This is my first posting in this forum and hopefully someone can direct me to a direction.
What I am trying to do is loading external text which contains hyperlinks(to other text files) into a dynamic text field and when a link is clicked, the text field will be loaded with new text. The part I couldn't figure out is how to load new text into the text field, intead of opening that text in a new browser window. I am using MX on PC.
Thanks for the help in advance!
Yachun
Text Loaded With LoadVars
I want to make a guestbook, so I have made a flash, php file and a txt file.
I use php to save the new message into the txt file. ( It's work!! )
However, when I want to load the message inside the txt file, i used the LoadVars object.
Since the message is in html, I added a code:
myData=new LoadVars();
message_txt.htmlText=myData.entries;
And my txt file is like that:
&entries=<font color="#FFFFFF">Name:</font> Admin
<font color="#FFFFFF">Email:</font> <font color="#990000"><u><A href="mailto:Admin701@yahoo.com.hk">Admin701@yahoo .com.hk</A></u></font><br>
<font color="#FFFFFF">Posted:</font> 08/22/05 03:06 PM
<font color="#FFFFFF">Message:</font> Write entries here
But after the flash player have loaded, text shown in message_txt became....(all things are still here)
font color="#FFFFFF">Name:</font> Admin
<font color="#FFFFFF">Email:</font> <font color="#990000"><u><A href="mailto:Admin701@yahoo.com.hk">Admin701@yahoo .com.hk</A></u></font><br>
<font color="#FFFFFF">Posted:</font> 08/22/05 03:06 PM
<font color="#FFFFFF">Message:</font> Write entries here
Am I miss sth. in the script ?
How To Use UNICODE Text In LOADVARS?
Hi everyone, does any of you knows how can I use UNICODE in loadvars, I doing a work and I need to load spanish word, this language uses symbols like ´ or ñ, and flash don't load them propertly. If any one knows how to do this please post a reply THANKS.
CS3 Loadvars To Get Db Text Not Showing
hello all,
I have a swf that uses a php script to grab text from a database and I am using load vars to load the text into a dynamic text field. For some reason the text is not showing though when I put a trace on the variable - all the text from the database shows up in the output screen.
here is my code:
Code:
stop();
var whereToGo:String;
//------------text loading from db http://www.darrenholden.com/
scroll_mc._visible = false;
theText_txt.htmlText = 'LOADING FROM DATABASE.....';
var send_lv:LoadVars = new LoadVars();
var rcv_lv:LoadVars = new LoadVars();
var lvData_xml:XML = new XML();
lvData_xml.load("http://www.darrenholden.com/startText.php");
lvData_xml.onLoad = function() {
var my_array:Array = this.childNodes;
//trace('my array length ' + my_array[5].nodeName);
var myArray_length:Number = my_array.length;
for (i in my_array) {
if (my_array[i].nodeName == 'data') {
var data_array:Array = my_array[i].childNodes;
for (j=0; j<data_array.length; j++) {
//trace(data_array[j].nodeName);
if (data_array[j].nodeName == 'artical') {
artical_array = data_array[j].childNodes;
details = artical_array.join("");
theText_txt.htmlText = details;
if (theText_txt.maxscroll > 1) {
scroll_mc._visible = true;
} else {
scroll_mc._visible = false;
}
trace(theText_txt.htmlText);
//trace('maxscroll:'+theText_txt.maxscroll+' bot:'+theText_txt.bottomScroll);
}
}
}
}
};
that should mean my php code is working fine - so my problem must be with my flash AS - any ideas??
thanks,
LoadVars Text Drops
Hello,
I am having issue with my html file dropping. I have a master swf, and inside that master swf with a mp3 player the progressively downlaods external mp3. From that master swf other external swfs load into the master (when click on buttons) I have completely different loadVar names for each othe the sections loading and the mp3 player -
but for some reason, it will load the .html file but after a minute or so, will drop the file and leave my text field blank...whats going on????
here is the coade to one of the sections:
Code:
var myAboutLV:LoadVars = new LoadVars();
var tChangeInterval:Number = setInterval(tChange, 5);
myText._alpha = 0;
myAboutLV.onLoad = function(success) {
if (success) {
myText.htmlText = myAboutLV.info;
} else {
myText.text = "There was an error when loading the external file.";
}
};
myText.html = true;
myText.condenseWhite = true;
var cssStyles:TextField.StyleSheet = new TextField.StyleSheet ();
cssStyles.onLoad = function () {
myText.styleSheet = this;
myAboutLV.load("about.html");
};
cssStyles.load("styles.css");
function tChange() {
myText._alpha+=5;
updateAfterEvent();
if (myText._alpha == 100) {
clearInterval(tChangeInterval);
}
}
LoadVars(); Text Formatting
Can anyone help please; I've been lumbered with a problem that's causing a real headache. I am much more of a designer that a programmer, so bear with my logic.
I am loading a text file containing variables that are generated from another form in a different flash movie. e.g. &client_name=Mr S Smith&address=The Grange
The problem is that the text file puts double line breaks in to the text when loaded into flash, so i used Load which I read somewhere removes these line breaks, but I'm getting %20 for spaces now and %0D %0A ect.
My question is, how do I get rid of these from my text? I would be very grateful of any suggestions.
The text field is being loaded into a flash movie using the
ActionScript Code:
myLoadbleData = new LoadVars();
myLoadbleData.load("textVars.txt", ");
I then convert the data into a string which is then split into an array to load the data back into various text fields.
ActionScript Code:
var varData= myLoadbleData.toString()
var teller_array = varData.split("&");
Thanks
Ragnaroo
LoadVars Html Text
I have a txt file with and html formatting, but the html tags are showing up in the dynamic text field. The "render text as html" button is selected in the Property Inspector.
For example, here is what I currently have in my txt file:
titles=<b>Ox Cart, Traiguen</b>
Oil on canvas
27 x 17 1/4 inches
Signed lower right FREDERIC REMINGTON
Illustration: Harper's Monthly, October 1890, p. 782
I have tried using <br> and <i> tags, but have had no luck with them either. I believe something is off with my formatting. (Just a note, "titles" is the variable that is loaded by the LoadVars.)
Thanks for any help!
Using LoadVars On Different Scenes With The Same Text Box
Hey everyone, I often come her using searches on google and find it's an amazing place for help.
Anyway, I copied the programming for my portfolio from http://actionscript-toolbox.com/flashmx_intro.php and just from debugging and such, I've learned alot. But I did a search for loadVars (to see what exactly it is) and it seems that it's used for MySQL, PHP and importing and exporting FlashMX stuff, which is I guess what I want, but I don't know much about it. (So when I am writing variables, is that actually PHP or what?)
My problem is, I can get the text for the first scene to work, but for the second, nothing shows up. The textbox in the middle of the "website" is supposed to change between each scene, so home.txt will show up when in the home scene and the education.txt will show up in the education scene. I've tested the second scene's text on the first scene and it shows up so I know it's not reading it incorrectly. I think it has something to do with closing the txt file from the first scene to the second. Can someone please help me out?
All the files are located at:
http://home.cogeco.ca/~ralton/Portfolio.zip
Any help is much appreciated.
LoadVars() And Text Format
i am working on this lovely site for a modeling agency:
www.skynninc.com/new
go to the about skynninc page!
note: if enough people are interested then i will write a tutorial on how to dynamically create and load in content without being cached... using Flash <-> PHP <-> MySQL... it took me loooooooooooong hours to figure out...
anyway about MY question...
i am having some trouble with using a LoadVars object to put text into some text fields.. well not the part of getting the text there, but the formatting... i think external XML files might be the way to go... but heres my current code
Code:
introText.aboutIntroText.text = "Loading...";
loadMyText = new LoadVars();
//this simply stops the txt file from being cached
myIdentifier=Math.round(Math.random()*10000);
loadMyText.load("update/about.txt?uniq="+myIdentifier, "GET");
loadMyText.onLoad = function (success) {
if (success) {
introText.aboutIntroText.text = String(this.intro);
} else {
introText.aboutIntroText.text = "!!ERROR - Content not found!!";
}
}
the text gets there fine, but if i put in HTML tags (even if the render as HTML button is selected) the actual tags show up in the text... which obviously kinda sucks haha... i dont have any problems if i just use loadVariables(url);
but i really need to use LoadVars (okay i want to... but dont make fun)
any ideas?
LoadVars From Text File
Hi,
I have a problem with a loadVars script, I'm loading variables from a text file with loadVars, it's loading it all in fine, but not recognising the variables...
I'm doing it the same way I've always done it (though I usually use php).
My text file is structured:
Code:
&myVar1=blahblah1.swf&myVar2=blahblah2
And it loads into Flash, displays in the output Window, but looks like this:
Code:
&myVar1=blahblah1%2Eswf%0D%0A&myVar2=blahblah2
And if I trace for myVar1 it returns "undefined"
Any help with this?
Here's my loadVars script(the other functions are on a later frame):
Code:
theLink = "mainmenu.txt";
function loadDetails(loaded) {
if (loaded) {
trace("It is in there!!!!"+mainMenuData);
play();
} else {
trace("your data didn't load");
}
}
mainMenuData = new LoadVars();
mainMenuData.ignoreWhite = true;
mainMenuData.onLoad = loadDetails;
mainMenuData.load(theLink);
stop();
LoadVars Text Formatting
Well, I spent about thirty minutes searching through the help files/this forum/macromedia's site for the answer to this question, but I guess it's just to undocumented. So, I remember seeing a link somewhere that outline the way Flash MX reads the dynamically loaded text files. If I recall correctly, it had it's own notation for line breaks (equivalent to "/n" in actionscript) and other formatting (as the technotes about HTML stuff didn't mention the < BR > command so that's out of the picture). Anyway, thanks for the help in advance.
--Elios
Loadvars Text Destination?
if i have some code like this:
ActionScript Code:
menu=new LoadVars()menu.load("menu.txt")menu.onLoad=function(){ clip.blackwriting=menu.blackText clip.redwriting=menu.redText clip.greenwriting=menu.greenText clip.bluewriting=menu.blueText }
And i wanted to put it on a website like freewebs, where would i put the text file, or would i have to have my own domain name?
Use Same LoadVars For Different Text In Different Text Boxes
Hi everyone! I've been stuck with this for a couple of days now and I give up! I'm either blind or stupid...
I load different exteranl text files into different moviclips with a dynamic textfield in them. I apply the same css to them and then load the text. Since I'm doing this through out my project I thought I make a nifty little function to use over and over agian. This is how faar I got:
Code:
// function defining mcName
function init(){
var mcName:MovieClip = useThis;
}
// function to load external text in a specific textbox and applying css styles
function getMyStyles(txtURL:String, useThis:MovieClip) {
// get the var mvName into this function
init();
// set the value of mcName
set ("mcName",useThis);
// load stylesheet
var cssStyles:TextField.StyleSheet = new TextField.StyleSheet();
cssStyles.onLoad = function(success:Boolean) {
// if it works applt css to the text box
if (success) {
_root.mcName.ort.styleSheet = cssStyles;
//load text content into textbox - see function below
getContent(txtURL);
} else {
// error message
_root.mcName.ort.text = "There has been an error loading the required information.";
}
};
// load the StyleSheet
cssStyles.load("styles/styles.css");
}
// load external text to the textbox. A variabel tells whichtextto get
function getContent(txtURL:String) {
// create LoadVariables
var nameLV:LoadVars = new LoadVars();
nameLV.onLoad = function(success){
if(success){
_root.mcName.ort.htmlText = nameLV.info;
} else {
_root.mcName.ort.htmlText = "There has been an error loading the text.";
}
}
nameLV.load(txtURL);
trace("it works!");
}
// load first text into first movieclip with textbox named "ort"
getMyStyles("vars/datum/test01.txt", mc_ort01);
// load second text into second movieclip with textbox named "ort".
getMyStyles("vars/datum/test02.txt", mc_datum01);
As I have assigned the same instance name for the text fileds in the different movieclips only one text will show. But at least something shows. So - I changed the instance names in the movieclips and declared a variable to specify the instance name ofthe text field. see Code below. Now nothing shows... And I can't figure out why! Please anyone??!!!! I've attached the files in case it helps in helping...
Snowgirl with melting brain...
Code:
// function defining mcName and text field
function init(){
var mcName:MovieClip = useThis;
var mcNameIt = useThat;
}
// function to load external text in a specific textbox and applying css styles
function getMyStyles(txtURL:String, useThis:MovieClip, useThat) {
// get the var mvName into this function
init();
// set the value of mcName and text field
set ("mcName",useThis);
set ("mcNameIt",useThat);
// load stylesheet
var cssStyles:TextField.StyleSheet = new TextField.StyleSheet();
cssStyles.onLoad = function(success:Boolean) {
// if it works apply css to the text box
if (success) {
_root.mcName.useThat.styleSheet = cssStyles;
//load text content into textbox - see function below
getContent(txtURL);
} else {
// error message
_root.mcName.useThat.text = "There has been an error loading the required information.";
}
};
// load the StyleSheet
cssStyles.load("styles/styles.css");
}
// load external text to the textbox. A variabel tells which text to get
function getContent(txtURL:String) {
// create LoadVariables
var nameLV:LoadVars = new LoadVars();
nameLV.onLoad = function(success){
if(success){
_root.mcName.useThat.htmlText = nameLV.info;
} else {
_root.mcName.useThat.htmlText = "There has been an error loading the text.";
}
}
nameLV.load(txtURL);
trace("it works!");
}
// load first text into first movieclip with textbox named with value of "useThat"
getMyStyles("vars/datum/test01.txt", mc_ort01, ort);
// load second text into second movieclip with textbox named with value of "useThat"
getMyStyles("vars/datum/test02.txt", mc_datum01,datum);
Scrollbar Using Loadvars And Dynamic Text
Hi just wondering if anyone could help...
I'm loading text dynamically into a scroll-bar controlled text box using the code below in frame 1 of my movie.
Code:
loadVarsText = new loadVars();
loadVarsText.load("bodytext.txt");
loadVarsText.onLoad = function(success) {
if (success) {
trace("done loading");
text.html = true;
text.htmlText = this.biography
} else {
trace("not loaded");
}
};
stop();
This works fine. The problem is that in frame 2 I want to load a different variable into the textbox. Firstly, should I have all the code above in the second frame with a different variable name (instead of 'biography'), or is there a more elegant way to do things?
Secondly, if I do repeat the code with a different variable name, it does work except the scrollbar seems to keep as it is (i.e. doen't change length according to the different amounts of text in each variable). Any way to 'refresh' the scroll bar so it picks up the correct length??
Any suggestions would be very greatfully received.
Thanks for your time.
Scrollbar Using Loadvars And Dynamic Text
Hi just wondering if anyone could help...
I'm loading text dynamically into a scroll-bar controlled text box using the code below in frame 1 of my movie.
Code:
loadVarsText = new loadVars();
loadVarsText.load("bodytext.txt");
loadVarsText.onLoad = function(success) {
if (success) {
trace("done loading");
text.html = true;
text.htmlText = this.biography
} else {
trace("not loaded");
}
};
stop();
This works fine. The problem is that in frame 2 I want to load a different variable into the textbox. Firstly, should I have all the code above in the second frame with a different variable name (instead of 'biography'), or is there a more elegant way to do things?
Secondly, if I do repeat the code with a different variable name, it does work except the scrollbar seems to keep as it is (i.e. doen't change length according to the different amounts of text in each variable). Any way to 'refresh' the scroll bar so it picks up the correct length??
Any suggestions would be very greatfully received.
Thanks for your time.
Scrollbar Using Loadvars And Dynamic Text
Hi just wondering if anyone could help...
I'm loading text dynamically into a scroll-bar controlled text box using the code below in frame 1 of my movie.
Code:
loadVarsText = new loadVars();
loadVarsText.load("bodytext.txt");
loadVarsText.onLoad = function(success) {
if (success) {
trace("done loading");
text.html = true;
text.htmlText = this.biography
} else {
trace("not loaded");
}
};
stop();
This works fine. The problem is that in frame 2 I want to load a different variable into the textbox. Firstly, should I have all the code above in the second frame with a different variable name (instead of 'biography'), or is there a more elegant way to do things?
Secondly, if I do repeat the code with a different variable name, it does work except the scrollbar seems to keep as it is (i.e. doen't change length according to the different amounts of text in each variable). Any way to 'refresh' the scroll bar so it picks up the correct length??
Any suggestions would be very greatfully received.
Thanks for your time.
LoadVars Access To Error Text
When an asp page returns codes successfully the LoadVars object has access to the name value/pairs. But if the ASP chokes on an error condition there are no name value/pairs. The onLoad method can detect the error (success = false) but how can we retrieve the text of the error message itself?
LoadVars Problem Image/text
I have a serious headache about a php/loadVars thing in my fla. It must be so simple....
Could somebody please check out this thread i posted on scripting and backend section:
http://www.flashkit.com/board/showth...hreadid=516839
|