>>> Variables With Text <<<
with numbers i used:
on (press) { score = Number(score)+1;
but if i want to write something as "correct"???
thanks
FlashKit > Flash Help > Flash ActionScript
Posted on: 01-10-2003, 04:00 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Loading Variables From Text File. ( Not Fixed Variables )
i would like to know how to make my Flash werbby load variables like this automatically everytime i load my flash webby
(this is contained inside a text file) example:
&news[15462]=hello&
&news[14890]=uuuuuuuuuuuh :P&
but i won't be using fixed numbers. these numbers will be randonmize. but how do i tell my textfield to load allll variables that contain the word "news" and a value (number) ? or is there any other ways of doing this?
[Edited by xanbarian on 07-08-2002 at 12:56 AM]
Assigning Dynamic Text File Variables To Variables
Ok so I know exactly how to load variables from a text file and catching these variables in a dynamic textbox to show there string content. But I wanted to work with the string in the passed variable (ie from txt file) BEFORE I display the text in the dymnic text box. I seem to be having trouble assigning the passed .txt file variable to a newly created variable in my movie, it keeps saying "Undefined" when I run a trace().
<code>
//The contents of the text file looks like this
&textxxx=This is the text withing the text variabale
//1st frame, layer 2 in main
loadVariables("text.txt", _root)
//1st frame, layer 1 (below layer 2)
_root.strText = _root.textxxx
</code>
->So why does it say strText "Undefined" !? Does flash not allow variables to be assigned to variables?
If you help that would be fantastic
Return Variables From Php To Load In Flash Text Variables
Im having an issue using the kirupa flash login. I already have the actual login working with php and mysql but i need to change it up a little bit and i don't know enough about php to write it myself. But here's the situation.
Flash login is a basic script, I've already modified this part and it works great
What I need to know is how to modify it so when a user logs in, php captures the $_POST and returns the alternate variable fields that consist of ("co","fname","lname","cph","email") within the ID for user and pass
also i have already made a common loadMovie to load random variables i just need the php to point to the movie
Comparing Variables To Variables In A Text File
I am trying to make a login in flash and I would like to have a txt file with user names and one with passwords or have one file with both. When they click submit it will see if the user name and password they entered are in the text file if they are it will do one thing and if they are not it does another.
Dynamic Text: Detecting If Variables Match In Two Text Symbols?
Here's the problem:
I want to play a sound (or play an animation, whatever) if the first variable in one dynamic text is displayed at the same time as that in another dynamic text.
It works so that, when I press a button, one text field randomly displays one of "pizza" or "ham" and the second text displays randomly one of "is good", "is bad" or "yuck". Now I want it to play a sound when the random display comes up with "pizza is good".
I tried an educated guess with:
code:
if (_root.tiptext.variable == _root.tiptext2.variable) { play-sound }
but that doesn't work.
Any help?!?! (see attachment also)
P.S. don't ask why such a stupid program, it's just a test ^^'
Text Problem, Variables Text Lose KERNING?
Hi,
I plan to get my movie getting is text from a text file, this will let me the opportunity to have my movie updated easier, change language on the go, etc...
But i'm facing a problem, i first created a text field, putted some text in it then i decided i would use a external txt to fill the text field, so i cleared the text field and gived him a variable name...
but i realised by doing that, i lost my KERNING ON MY TEXT.
is there a way to keep it? actionscript? doh!
help
Mult Text Variables From One Text File?
i'm making a calendar that - at this time - loads 30 text files to fill in each day's information.
i'd like each of these text variables (days) to load text all from one .txt file.
is that possible?
Loading Text Variables From A Text File
Well Im quite new to Loading text variables and creating a way for our clients to easily add news and update a "news" textfield, and I would appreciate it if someone could provide some samples or sample ActionScripting coding & a brief description of how-to do it, thnx its greatly appreciated.
Links to a good Flash MX tutorial on this would be also great.
Load Variables From Text Then Loading Image File With The Filename Given In Text File
The problem is, that i need flash to load variable from text file, eg: info.txt, with image=gt.jpg in it.
Then I want flash movie to load a gt.jpg into a blank movie.
The point is that after i change filename in txt file, i want movie to load that img.
I wrote AS:
loadVariablesNum("info.txt", 0);
loadMovieNum(image, 0);
but it's not working
After i traced variable image, debugger showed that this variable undefined, but if i put textbox with image as variable, it shows "gt.jpg".
Please help
Text Variables
I have an input text box in a mc in one scene and I want it to show up in a dynamic text box in another mc, in another scene. I have tried using set variables etc, but to no avail. Maybe my brain isn't working too hot today.
Anyone help?
Cheers.
Variables And Text
Im having problems with variables and text boxes.
all i want, is a button to increase the number of a variable in a text box, and i cant get it to work
this is what im doing
var number;
number = 0;
var text;
text = number;
but then the number 0 doesnt show up in my dynamic text box. and i dont know what to use to increment the #
Text And Variables
Hi I am writing a in a text box and would like to use data from a variable called InterestVar. AN example for this is on one scene it may say type your name in youe type 'dave then on the next scene a text box would say 'hi dave hope you are well'. I would like to write something like 'hi $InterestVar$ hope you are well'.
Has any one got a clue how to do this
cheers dave
Variables Within Text
I was trying to get this to work, but at no avail. I was hoping you folks here at flashkit could help me out. I have a two variables, lets call them bob and Jim. Now there's another i have, and its a text box. (Dynamic text of course) and what i am trying to do, is have the text box say something like:
Bob is walking down the road.
or
Jim is walking down the road.
But i haven't a clue as to how to integrate the variable names into the text box variable. Any answers?
Variables (Text)
Hi Flashkit, need some help if possible...
I am creating a presentation on CD, using .txt files loAded as variables to automatically change information on the presentation for each particular client without having to change the presentation as a whole.
Question: As far as I am aware it is not possible to format text in a .txt file. Can the imported text be formated (with Bold, italics, paragraphs etc...)as it is loaded in to Flash (I'm using MX?).
Grateful for some of that wisdom out there if possible...
Thanks,
DbyD
Text Variables
text variables....more specific....the exact code below.
(hr+":"+mnt+""+daytext+""+mm+""+dd+","+yyyy)
I plug this code into an empty dynamic text box and it functions with the aid of some addittional script. One problem....I need spaces between the date, time, and month and the placement of the type shifts everytime I launch the swf. What I am trying to do is to place the date month and time within a selected box on a separate layer....hope I am clear....What can I do to keep this text constantly static and have spaces between the time, date, and month?
Any suggestions would be greatly appreciated.
Text Variables
i'm trying to make a lap counter for my race game
but i can't get it to work...
how can I make a function that whenever my car(called vipergts)crosses a certain line (start) it reduces the number by 1 (or increases) and when it hits a certain amount, make the game stop (or go to another frame)
thnx
Text Variables
My apologies if this is as simple as simple can be but I've searched to no avail here for a couple hours now.
I want to set up a standalone that users can launch, type in thier name and then print out the resulting nametag. I've got the printing figured out but haven't had any luck figuring out how to hold and use the variable generated when the name it typed in.
After this I'm hoping to be able to have the users select a font but we'll take this one step at a time ; )
Thanks in advance.
Asp Variables/text
I tried checking with the search engine, but it seems to be bogus right now, so Ill have to post the question anyway...
I have a flash file with some dynamic texts, which will be drawn from ASP. To simplify the explanation of the project, here is the deal...
Flash needs to draw variables as text to dynamic boxes from an ASP. That ASP indicates which swf to load (different frame layouts), and each swf loads the appropriate variables into the text boxes
Now, i tried a couple of things, and didnt get anywhere. Oddly enough, it doesnt even identifies the error.
Here's the script:
myData = new LoadVars();
myData.onLoad = function(success){
if(success) {
titulo_txt.text = this.modelo;
conteudo1_txt.text = this.conteudo1;
} else {
titulo_txt.text = "erro";
}
};
myData.load("pagina.asp");
stop();
With titulo_txt and conteudo1_txt been the flash dynamic text instances and modelo and conteudo1 the asp variables.
Both come out 'undefined' when running. Im willing to guess its not an asp problem, cause our programmer is very good (though I know him long enough for the liberty of slapping him on the back of the head if its his fault ).
Anyone can lend me a hand here?
Text Variables
kindly requesting a little help.
using flash 8 i created a page using text variables which display the text in the text area field. no problem using the syntax (text=something).
what i can not figure out is if i can also include text which is hyperlinked. since it is in a variable text field i can not make the text dynamic. can it be done using syntax alone.
i hope i was clear enough, if not please ask for more info and i will try to accomodate.
thanks for your time everyone.
val
Text Variables
im having some trouble with dynamic text variables. im making a game that requires two actions for one button. ive heard of using the and operator but im not sure how to use it. i labeled the var: section in properties right.
my script needs to say:
on (release, dragOut) {
gotoAndPlay(10)and right += 1
}
i dont think thats right... mostly because it doesnt work anyways any help would be much appreciated.
Using Text Variables
Hi... I hope you don't think I'm stupid now, but I just can't get my head around this..
I think what I'm having trouble is conditional statements about string variables... Like if (lastChange == "bild1child"). Is that the way to do it?
Code:
/*
This is going to use variables loaded from the html-file later, like:
banner.swf?bild1=/bilder/banner1&bild2=/bilder/banner2&bild3=/bilder/banner3
but now they are predefined for error-testing
*/
var bild1:String = "/bilder/april.jpg"
var bild2:String = "/bilder/avril.jpg"
var bild3:String = "/bilder/pastill.jpg"
var bild1Request:URLRequest = new URLRequest(bild1);
var bild1Loader:Loader = new Loader();
bild1Loader.load(bild1Request);
bild1Loader.x = 0;
bild1Loader.y = 0;
var bild2Request:URLRequest = new URLRequest(bild2);
var bild2Loader:Loader = new Loader();
bild2Loader.load(bild2Request);
bild2Loader.x = 0;
bild2Loader.y = 0;
var bild3Request:URLRequest = new URLRequest(bild3);
var bild3Loader:Loader = new Loader();
bild3Loader.load(bild3Request);
bild3Loader.x = 0;
bild3Loader.y = 0;
var bildTimer:Timer = new Timer(3000);
bildTimer.addEventListener(TimerEvent.TIMER, changeBild);
addChild(bild1Loader);
var lastChange:String = "bild1child";
function changeBild(event:TimerEvent):void
{
trace("det funkar " + lastChange);
if (lastChange == "bild1child")
{
removeChild(bild1Loader);
addChild(bild2Loader);
var lastChange:String = "bild2child";
}
else if (lastChange == "bild2child")
{
removeChild(bild2Loader);
addChild(bild3Loader);
var lastChange:String = "bild3child";
}
else if (lastChange == "bild3child")
{
removeChild(bild3Loader);
addChild(bild1Loader);
var lastChange:String = "bild1child";
}
}
bildTimer.start();
Thanks for your time!
Text Box Variables
Hi I'm a complete newbie at actionscripting (and any other programming languages -.-), and I read the first few tutorials and tried to do something on them.
What I was thinking was to have a button template, that would be one symbol. And then I would have different instances of that button template, and the instance name would be the text that would appear on button.
Except I have two problems:
When I do what the tutorial says, I realized that I need an "On" handler... and that's not what I really want.
Additionally, the text box leaves a white background so it looks ugly.
Would some veteran help me please?
Text Box Variables
Hi,
I have an input text box on the main timeline - I've given it the VAR name "tb1".
I want to load an external swf (print.swf) into a movieclip (named print_mc)also on the main timeline. In the external print.swf there is a another dynamic text box (named box2) into which I need to load the text that has been entered into the input text box on the main timeline.
I've tried puting this into the external swf but it doesn't work!!
box2 = _root.tb1
stop();
What's the best way to do this please?
Thanks.
Text And Variables
Hello Forums,
Just for some fun, i'm trying to make something somewhat similar to a stat calculator. I'm testing out my design using the base for a MMORPG game; where as the character level increases they gain base attributes but also additional attribute points that they can spend on those attributes. So for example;
A character has, health, attack and defence, at level 1 those stats are low, at level 2, those stats increase with a predefined build, however the character also gains 4 additional points which they can use to raise a specific stat if they wanted to.
So basically saying, at level 100 you would have 400 additional points ontop of your predefined build, I have an 'Input Text Box' where you obviously type in your level, then I am using a 'Dynamic Text Box' which is to display how many additional points you will have at what level.
My question is, how can I set up a variable (through the 'Input Text Box') where whatever number you were to type in, it would be multiplied by another number and then displayed (from the 'Dynamic Text Box')
Thanks in advanced to anyone who can understand and answer.
[--------- Loading Text Variables ---------]
Guys and Gals,
The scenario: I am building a Flash emailer for a client who wants to be able to change the contents of the "flashy text bursts" so that they can target multiple email groups without reworking the entire Flash movie everytime they do it. This client loves to change their mind (Which doesn't right?)
The solution: I am using Action-->"load variables" to populate text fields in animated movieclips... that is no problem... but I have little control over layout.
The Question: Can I somehow send a carriage return along with my variable values? ex: Textbox1=Catchy Gimmick Guaranteed(RETURN) to knock your frickin' socks off!
You're help is appreciated!
-RASTERB8
How Do Set A Variable With Text That Has Other Variables?
im trying to set a variable to dynamic text with a text that has multiple variables in it. I want it to show those variables as they equal not as the word.....
example:
actionText = Hero attacks monster with att damage leaving him with monHP hitpoints.
hero,monster,att,&monHp are variables
i want it to read like this...
Slayer attacks Knight with 14 damage leaving him with 22 hitpoints.
please help
Please Help.. Sending Variables To A Text Box
on (press) {
_root.a2 = Number (boxes.glo._x);
}
I want to send the Location X location of boxes.glo to the text box _root.a2 but it just comes up blank.. or with a 0 I can just put in a # to accomplish this but I need it to be more dynamic than that.. Please help Thanks
54
Dynamic Text And Variables...
What I'm trying to accomplish:
Having a list of news article headlines from a third-party vendor. (I can get this to display properly via the loadvariables command). They are displayed in dynamic text boxes. The headline is associated with a NewId #.
I need to find a way to pass that variable back to the server so it knows which new article to grab, and format a dynamic page that outputs the info. I've got the second page all coded, I just need to know if it is possible pass that variable to the second page so it will output the info that fills the dynamic text boxes in frame 2, and how to pull that info on in??
I hope this makes some sort of sense. Anyone, Beuhler??
Imput Text (variables)
Hi there
I was wondering if someone could give me some advice on a tutorial, I need to create a kinda e-card whereby user types thier name and vwullu... next frame is the animated greeting card with their name bouncing around the screen.
thanking you
(baie donkie)
Variables Load Into Same Text Box.
http://www.angelfire.com/apes/grapeape
click on services.
ok, got that snazzy menu there. want to load variables from <b>same</b> text file into <b>same</b> scrolling text box.
is it possible. The textbox is called "services". Can I somehow change the name of the text box for loading the text. I guess I can always just make like 8 text files and load each one, but there's got to be a better way. Any input?
thanks in advance.
-fred
p.s. yes, I know the site map doesn't work. I'm working on it!
Comparing Text Variables
i am trying to make a little spelling excercise game for some elementary kids, i have 2 text boxes, one called "word1", in frame 2, and one called "text" in frame 3
"word1" text box calles a word from a text file and displays it, the user then clicks on a try to spell button, and it takes them to frame 3 with the blank box called "text" they then enter their word here. then i want to compare the spelling of the word from "text" to the proper spelling from frame 2 "word1". i am using a if statement in the comparison
eg
if( word1 eq text)
if this is true it will take them to scene 2, if this is false it will take them to scene 3.
but this seems to not work, i also have tried many combinations and trials using stuff like this in my if statement...
text.caption eq word1
text.caption eq word1.caption
_root.text eq _root.word1
plus all sorts of combinations of these.
how can i write this so it actually compares my entered text into frame 3 text box called "text" with the text from the word1 file i read in called "word1"
the lost and confused Katana
Input Text Variables
hi.
i'm new to actioncript, so no flames please.
i'd just wanted to know how to read a variable from an input text box.
i have this inp txt box, on the text options i give a name to the var
then what do i need to do next to read that variable (the entered text on the input text box)?
the variable is only used on this movie (i dont want it to be used with javascript, vbs. Its not to be used as html post method GET/POST).
the idea is to have a inp txt box, read the content entered and if content = someword, then goToAndPlay(x).
do i need to create a confirmation button, i.e an ok/submit, so i can read the entered text? or can i just hit enter when i finish typed?
and how can i get the cursor to focus on that txt field? i tried setFocus, getFocus, and some more but without success.
thanks.
Formatting Text In Variables
OK, i got the movie to read from a text file.
I can add returns, but is there a way to bold certian words? or create links like HTML?
Variables From Text File
Hello, can somebody help me please,
I've a problem with importing variables frome a text file.
without using scripts like PHP,ASP,.. because i've no webserver, just using FLASH 5, dreamweaver
i've a text file called : variablelist.txt, where i've stored some variables for a password and loginID, so i can give access to the site for some people
in the txtfile :
clientID-001=AAAAA
&clientID-002=BBBBB
&clientID-003=CCCCC
&password-001=11111
&password-002=22222
&password-003=33333
in the movi :
at the frame where the user can put his loginID and password in the dynamic input field with variables : user2 and pass2 i've put the action :
loadVariables ("http://www.iddea.com/05_txt/variablelist.txt", "");
at the enter button in the same frame i've
on (release) {
if (user2 add pass2 eq clientID-001 add password-001) {
aanspreking = "goodmorning naam1";
gotoAndPlay (50);
} else if (user2 add pass2 eq clientID-002 add password-002) {
aanspreking = "goodmorning naam2";
gotoAndPlay (50);
} else if (user2 add pass2 eq clientID-003 add password-003) {
aanspreking = "goodmorning naam3";
gotoAndPlay (50);
} } else {
gotoAndPlay (27);
}
}
but it seems that when i enter the password and userID that it won't work, can someone help me please
Multiple Text Variables?
heres an example of what I'm trying to do....
take a quiz question...
"what are the 3 closest planets to the sun?"
theres 5 dynamic input text boxes
(5 chances to get the right planets)
and a "go" button to check if the answers are right
how can I load the variables from all 5 inputs into one variable
then check if the correct 3 (planets) are there
...in any order.....excluding blank or wrong answers.....
then hit "go".....if the 3 correct answers are present
....goto and play frame " "
is this not such an easy task????
any help/direction....
-TNX-
hoopty
Help With Sending Text Variables
I am building an online quiz, and I need to send the results (Name and score) to a formatted text file of some sorts. Does anyone have a php script and some advice to the best way of doing this? I have searched for scripts and all I have found are forms and mail scripts...
Thanks
Variables In Text File Q's
I am having some trouble finding out how to put variables in a text file, take them from it, and how to set up the text file.
I do not know if there is any special way to set up a text file to put variables in it.
I basically know that you have to get the variables using the load variables action and put the name of the file in there(something.txt)
Can anyone explain this?
MX - Variables & Text Fields
Hey,
I have 2 text fields, both draw variables from an external text file into them.
textField1.autosize = true;
textField2.autosize = true;
textField2._x = textField1._x + textField1._width + 10;
textField2._y = textField1._y;
The above code is to make the second text field align to the right of text field 1. This works fine when the variables are set in the movie already, but when I try it with the variables loading in from a text file, it's only aligning 10 pixels from the left, effectively appearing on top of the first text field.
Is there a way of solving this?
Submitting Text Variables
I am experimenting with writing variables out to a web page, but when I examine the server logs, it does not seem that they are being sent.
My "Save" button movieclip has the code:
on (release) {
loadVariablesNum ("http://test.ponydom.com/test/dump.html", 0, "GET");
trace ("vars dumped");
}
The trace comes up fine, and the hit to the server comes up in the log, just with no query string.
I tried adding a test variable in my on (release) statement, and that variable came through. How do I tell it what variables to get out of the _root ?
What is the difference between loadVariablesNum and loadVariables and getURL, and why would I choose one over the other?
Any help would be deeply appreciated.
[Edited by elindelef on 07-15-2002 at 12:31 PM]
Text File Variables
Hi,
I have a flash movie with several dynamic text fields and would like to be able to load text from an external textfile with multible variables, so I don't have to have a text file for every text field in my movie but gather the whole load in one file.....is this possible and how?
Thanks for any help on this
Loading Variables From Text
hi. i am having a little difficulty loading variables from a text file. i can use the variables just fine, the problem i have encountered is when i want a loop to load certain variables. say i have t1, t2, and t3 defined in the text file, and an array, myArray initialized in the program. my loop would be as follows:
for(i=0;i<3;i++){
myArray'['i']'=t+i;
}
i've also tried "t"+i, and 't'+i, but the array contains just the number that 'i' was at the time (1, 2 and 3; t was probably null seeing as how there is no t var).
if anyone knows how to use variables in a manner like this, please get back to me. thanks for looking.
-phlanagan@hotmail.com
Input Text And Variables
I am running a multiplication tutorial for my fourth graders. I give the problem and then they enter the answer. If they are wrong, it says try again. If correct it continues. Everything is working perfectly, except that if they miss the problem the first time, the "Try Again" doesn't go away. How can I get it to remove the Try Again?
on (release) {
if (an61 == 10) {
var GB = "0";
} else {
var GB1 = "try again";
}
}
Getting Variables From A Text File.
Friends,
A quick question that hopefully will only require a quick response.
1. I'm trying to load variables from a folder that is located on the same level as my Flash file. Example: "myFlaFile.swf" needs variables that are in the text file "Variable1.txt" within the folder "VariablesFolder" Both are on the same directory. How should the loadVar command read?
2. How can I put a whole bunch of variables, that'll be called at various times throughout a timeline, in one text file.
As always, thanks.
Layne Smith
Display Text With Variables?
Hey there.
I have about 150 text-based rollovers to display and thought it might be easier to use a variable that would hold the proper text and then get flash to display this variable (and thereby the text) when the button is rolled over.
Can someone tell me how this can be done? I am exporting as Flash 5.
thanks much for any help!
S
How Using Variables From Text File
Hi,
i know how to read from a textfile, but it doensn't seem to work.
i want to load a picture in a mc, this works when i use loadmovie en give the path with the filename.
Now i want to keep the path, but want to use the filename as a variable. So all my pics are listed in a txt file. Can somebody please help me??
this is for my trainnee post and is due friday. I must make pictures scroll from left to right, with some text beside it, and when clicked on the little image, up comes a new browser window. And they want to easily add pictures and and text to it, so i want to use that textfile, but it isn't working.
pllleeeaaassssseeee help, I really underestamated it (sorry if my english doesn't do well)
thnx
bye
Text Files And Variables
I have a text file with 10 variables that I'd like to use with ActionScript. I'm using the LoadVariablesNum ("text.txt", 0); to load the variables into my movie. But I don't know how to access them without using text fields. I set a text field up with one of the variable names in the file and I can retrieve the info fine. But I want the content in a variable and not a text field.
Anyone know what I need to do?
Any help would be much appreciated.
Thanks.
Loading Text And Variables
Hello.
I am trying to load a text file, and use variables from the text file to tell duplicated movie clips which frame to go to.
The text file contains "f1=20&f2=19&f3=12&f4=12..." and so on.
The bold text is the part that I think is giving me trouble.
Code:
onClipEvent (load) {
loadVariables("data.txt", this);
}
onClipEvent (data) {
startGo = true;
}
onClipEvent (enterFrame) {
if (startGo == true) {
if (i<20) {
i = i+1;
frame="f"+i;
duplicateMovieClip(_root.p, "p"+i, i);
_root["p"+i].gotoAndStop (frame);
.........
What am I doing wrong? How do I fix it?
Thanks for any help.
Variables From Text File
This is in the actions layer....
loadVariablesNum("copy.txt",0);
trace(cnum);
This is the copy.txt
opening=Watch here for instructions&
cname=Enter the client name here&
cnum=Enter the client number here&
fname=Enter your first name here&
lname=Enter you last name here
This is what i see "Undefined", why????
Loaded Text Variables
Please go to www.inmotion.net.au to view the following problem!
I have scrolling text loading as separate swf's-only problem is it creating uneven spacing between paragraphs, even though the remote .txt files have even spacing between paragraphs. How can I successfully format text from loaded variables?
Got any ideas?
|