Obtaining Variables FromHTML
How do I get variables from within the HTML page an SWF is embedded in? I tried loadVariables ("page.html", this) but that doesn't work. Help please?
FlashKit > Flash Help > Flash ActionScript
Posted on: 01-13-2002, 11:23 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Obtaining A Value From MX Check Box
I am trying to do a form in MX utilizing the built in UI check box component. It is a basic RFI form that posts the info to an ASP page and sends an email utilizing a simple mail program. I use this often, but only gathering info from dynamic text fields. Can anyone tell me how to get the value from the check boxes (true/false) and pass that info to my ASP page? Here is the URL if you want to take a look:
http://www.aprilrisk.com , then go to the order button.
thanks in advance for any and all help.
Wickles
Obtaining Coordinates
This is a follow-up to my question with Flash passing variables to Java. I need to obtain coordinates based off the users mouse position or object position. How do I go about this or are there any tutorials that could steer me in the right direction. Thanks.
Obtaining Current Url From Swf..?
Hi,
I'm trying to find a way to obtain the current url (as in the html page my movie will be sitting in, because it will be embedded in numerous pages) from within my swf in as3. Does anyone know how this might be done?
Many thanks
Obtaining Ip Address In Flash
How do I get the persons IP when they run the flash on there computer? Or rather when they view the flash?
Thanks
Klaser.
Obtaining Users IP Address
Hi all,
What's the quickest way of getting the IP address of a user into Flash without using CGI?
I'm pretty sure that it's done in Javascript but I'm not sure of the code
Obtaining Build Time Of SWF
I want my SWF to print out the time/date it was compiled, but can't seem to find an answer to this anywhere.
What I'm looking for is something that pulls out the modification time of the actual SWF file, or some other data embedded in the SWF at compile time.
Thanks in advance for any answers!
Obtaining The Width Of An Object
Heya,
What function do I use to obtain the width / height of an object?
I know the getBounds function will obtain the xMin, xMax, yMin and yMax of an objects relative position on the canvas, i.e. in the situation var a = object.getBounds gives you a.xMax, a.xMin etc. where this is its position on the canvas.
I want to be able to use the xwidth of an object as a similar variable.
Can anyone help? Thanks
Edited: 07/10/2007 at 01:32:25 PM by abimpson
Obtaining ComboBox Data
Hi there,
I am trying to figure out how to create the selected data in a combo box as a variable in my form.
Here is a part of my code as an example of what I want to do.
var orderVariables:URLVariables = new URLVariables();
orderVariables.custName = textName.text;
orderVariables.custEmail = textEmail.text;
orderVariables.custPhone = textPhone.text;
How do I reference my combobox as an entity of orderVariables?
Thanks
CM
Obtaining MovieClip Dimentions
Hello everybody,
I'm looking for a way to obtain the dimentions (width and length) of a dynamically loaded image.
I'm loading Landscape and Portrate images into an empty MC and wish to apply a different frame design according to image dimentions. For starters I wish to obtain its width dimention and continue from there...
ANy suggestions?
Thx, Kfir
Obtaining The Width Of An Image
Hi,
I am loading a series of images using the imageLoader.load(i mage stuff) function, and placing the imageloader into an array for future reference.
The images will have different sizes, and I need the size to properly position it. However, using the imageLoader.loaderInfo.width is giving me the width of the entire stage. How do I obtain the width of just the image?
Thank you very much.
Math
Obtaining The Dimensions Of A Loaded Movie?
I am loading movie clips into a point on my main movie screen. I need to find a way of detecting what the original dimensions of each loaded movie are so that I can scale them to fit an area.
The getBounds command will only return the actual minimum and maximum points of the graphic within the movie itself and NOT the original movie size. i.e. if the movie was 100*100 contained a 50*50 square in the centre then the getBounds command would return the following:-
xMin=25, yMin=25, xMax=75, yMax=75
and NOT
xMin=0, yMin=0, xMax=100, yMax=100
Anyone know a way to find this information?
Thanks
Obtaining The Dimensions Of A Loaded Movie?
I am loading movie clips into point on my main movie screen. I need to find a way of detecting what the original dimensions of each loaded movie are so that I can scale them to fit an area.
The getBounds command will only return the actual minimum and maximum points of the graphic within the movie itself and NOT the original movie size. i.e. if the movie was 100*100 contained a 50*50 square in the centre then the getBounds command would return the following:-
xMin=25, yMin=25, xMax=75, yMax=75
Anyone know a way to find this information?
Thanks
Obtaining LevelDepth Of A Movie Clip?
I've got an interface with some level swapping going on.. and I wonder if there's a way to obtain the leveldepth from a movie clip.
basically.. I've got 5 clips.. they all have a button with this action
//every time the button is clicked, it brings that clip to the top.
on (press) {
_parent.top = _parent.top+1;
this.swapDepths(_parent.top);
}
My dilema is I would like to check and see which clip is on the top so I can make that clip highlighted.
however I don't see any way to obtain leveldepth.. hopefully one of you gurus can help me???
Problems Obtaining Loadmovie Properties
I seem to be having some inconsistent behaviour with obtaining the _width and _height properties from a mc that I've loaded into a place holder mc on the main timeline.
The movie loads fine and I get correct results for all the properties of the mc other than for the width and the height properties.
I've placed the following code into the mc that I'm loading the new clip into:
onClipEvent (load) {
trace("width:" add this._width add " height:" add this._height);
}
This initially gives me the correct width and height of the clip that I'm replacing, but when the event fires when the loadmovie executes the values for the new clip (different size than the original clip) are incorrect (15.1 instead of 370 for the height and 108.5 instead of 256 for the width). The strange thing is that when I run in debug mode the properties that are shown in the debug display window are the ones I expected.
I've also incorporated the onClipEvent(data) method to make sure that I'm not prematurely querying the clip.
I hope someone can help solve this, it's starting to drive me insane...
Regards
Remko
Obtaining Associative Array Key Names
Is it possible to print the name of a key in an Associative Array? I would like to print the key names, not the values at that key.
For example, if I have the following associative array of an XML node's attributes:
xmlNode.attributes.name
xmlNode.attributes.order
xmlNode.attributes.size
How could I go about printing the following string:
"The attributes for this node include: name, order, and size."
Thanks in advance for any help!
Aaron
Obtaining 0::100 Numbers In OnEnterFrame Function
i wanted to obtain such numbers for changing _alpha property of the MC, the MC must disapear and apear slowly, otherwords alpha must change in such way: 0,1,2,3...100, 99,98,...1,0,1,2,...99,100.....
I was thinking and i found a solution..but i hope that there is one beter, cause here i use math functions..and cpu might be a little loaded.
here is the code:
_quality = "BEST";
square._alpha=0;
square.onEnterFrame=function(){
m=m+1;
n=n+0.07;
s=Math.abs(Math.sin(n))*100;
t=Math.abs(Math.sin(m))*100;
txt._alpha=s;
square._alpha=t;
//trace(s);
square._rotation=square._rotation+0.2;
//square._x=this._x+1;
_root.square._x = _root._xmouse;
_root.square._y = _root._ymouse;
//_root.txt._rotation=square._rotation;
_root.txt._x = _root._xmouse-40;
_root.txt._y = _root._ymouse-10;
}
i tried to use if (), but no wanted results, because square.onEnterFrame is a big cicle...
is there any other way to solve this? without math functions? maybe without square.onEnterFrame?
10x!
Help Obtaining An Object Reference From A String
Hello,
I'm new to actionscripting, but I've got a strong handle on OOP and javascript, so I hopefully won't need too much help.
Basically here's my problem:
I've got a bunch of thumbnails that perform actions when clicked on or hovered over. In one of the actions, I'd like to base the position of an element on my thumbnail's x/y coordinates. However, I can't seem to grab a reference to the thumbnail. I'd like to do something like:
obj = document.getElementById('objectName');
I see in Actionscript 3.0 you can call "getChildByName('objectName');" , but I haven't found anything analogous in AS1.0.
Does anyone have any recommendations?
It might also work if, in the button's "on(press)" and "on(release)" commands I could just pass (the reference to) the thumbnail object to the function I'm calling. I don't know how to do this either. I intuitively thought "this" should work when I'm writing code for that thumbnail's actions, but it appears "this" refers to the stage or something else.
Any suggestions? Thanks in advance. I'm sorry if this has been asked before...I tried to search for answers first but couldn't find any.
Obtaining Instance Name Without _stage Location?
Oki, i'm generating a few movieclip functions from an array that relate to an mc that's on the stage. However, in the mc.onRelease function, i can't seem to get the _root.filename = *** .txt to match the name of said mc instance. Instead i get a really long location for the mc on the stage Any ideas how i can get round this?
ActionScript Code:
var machines:Array = [unimatic,circularSaw,heatpress,embroidery,lineBender,laser,mugpress,vacuumF,linisher,profileCutter,pillarDrill,novamill,compactRouter];for(var i:Number = 0; i < machines.length; i++){ var mc:MovieClip = machines[i]; mc.onRollOver = function():Void { this.gotoAndPlay(2); } mc.onRollOut = function():Void { this.gotoAndStop(1); } mc.onRelease = function():Void { _root.attatchTab(); _root.filename = this + ".txt"; // THIS IS THE DEATH LINE >.< }}
Obtaining From A HTML Page & Displaying In Flash
Hiya People!
Does anybody have any idea how to obtain text from an external HTML page, and display it in a Flash movie.
I have a client who wants me to replicate the text from his HTML site in a Flash site that I am creating. The information this text is displaying will be changing every few minutes so I need set up a loop in the code used to obtain the text, so that my site will be updated automatically.
Hope you can help.
Deadhands
Obtaining A Return Value From A Local Connection Call
I have developed the following test which supplies a user ID from the first movie to a second movie using the LocalConnection method. I then Load the second movie in a container on the first movie. I then want trace the results of the sending Id in a trace statement outside of the LocalConnection method. Here is where the problem resides. I can not get the Id Variable to become available outside of the curly braces of the recieving method. Outlined below is the code I'm trying. Please help
Sending testing FLA
Code:
function adEngineOn():Void {
this.createEmptyMovieClip("container", 1);
loadMovie("test2.swf", container);
container._x = 10;
container._y = 100;
}
var id = 'bob';
var nmAdsend_lc:LocalConnection = new LocalConnection();
var oButtonListener:Object = new Object();
oButtonListener.click = function(oEvent:Object):Void{
nmAdsend_lc.send("_nmAdEngine", "afterLoad", id);
adEngineOn();
};
mybtn.addEventListener("click", oButtonListener);
receiving testing FLA
Code:
_global.lcReceipt = new LocalConnection();
lcReceipt.afterLoad = function(id:String):String{
trace ("This is the User_ID inside the function: "+id);
return(_root.application.container.id);
_global.User_ID=id;
};
lcReceipt.connect("_nmAdEngine");
trace("This is a trial of using a global for the ID: "+_global.User_ID);
trace("This is the User_ID outside the function: " + afterLoad());
Obtaining The Size Of An Image Using Loader Without Actually Loading It
Hi,
Does anyone know a method of figuring out the size of the target of an instance of the Loader class without actually loading it? For example, if I create the following code:
Code:
var url:String = "http://www.somewebsite.com/pic.jpg";
var image:Loader = new Loader();
var request:URLRequest = new URLRequest(url);
Is there anyway to find out the size of pic.jpg without assigning an event listener to image.contentLoadInfo for Event.OPEN/COMPLETE and calling image.load(request)?
Thanks in advance,
J
Sample Applications And/or Obtaining Apps From Influxis
Anyone have a list of other sites providing example apps and/or free applications for download? I also was interested in getting some of the apps from Influxis to test with. Has anyone been able to get any of those? LEt me know.
Obtaining A Variable From A Dynamic Text Field?
hey everybody!
i've got another problem. lol.
I have stored a value in a dynamic text field which has the instance name 'myPictureVar' and variable name 'desc'
so from this i get a dynamic text box with a value 'nopic.jpg' (pulled from a database which works fine!). This must mean that 'nopic.jpg' is stored in the variable 'desc'
what i want is to take the value in 'desc' and append it to another variable called $path = "http://www.failsworthschool.co.uk/Failsworth/files/"
so ive gone about it by doing this??
$imagename = myPictureVar.desc;
$picture =$path+$imagename;
so then the variable $picture will have the full path to the file??? but no it doesnt work, comes back with
http://www.failsworthschool.co.uk/Fa...iles/undefined
I think my problem is with finding where the actual value 'desc' is, so i can use it????
im bamboozled!lol
[AS2] Obtaining Information About Lines Drawn At Authoring Time
[ACTIONSCRIPT 2.0]
At *authoring time* (not runtime), having drawn onto the stage (or any other mc) is there a way, at runtime, for actionscript to be able to read back information about what had been drawn?
For example, if I had drawn a single straight line onto the stage, then tested the movie, the code I am looking for would return the X1/Y1 and X2/Y2 coordinates of the line.
The lines (or shapes etc.) would be drawn before the movie is run - not at runtime - as then it would be a case of simply storing the moveto/lineto parameters as the mouse draws those lines.
Basically what I'm after is something that reads the vector information for the shapes drawn at authoring time.
Accepted Method For Obtaining Values From Loaded Content
Hello,
I'm trying to determine if the way I have used in the past of accessing information about an mc is still valid, or perhaps there is a better way. Basically what I am referring to is if I load a jpeg into flash I can't tell the dimensions of that file until it has been read in fully. Meaning that I have to do my dynamic placements after they have been fully loaded - if I want it to be dependant on the dimensions of the file.
Normally I do something like this ->
Code:
mC.onEnterFrame = function():Void {
trace(this._x+'---'+this._y);
delete this.onEnterFrame;
}
thanks for the help
webg
[FMX] Obtaining The Server Time, Not Client Time?
Hi, does anyone know if it is possible to obtain the time (by functions similar to getSeconds) of the server the flash file is hosted on, instead of the client who is viewing the movie?
Thing is, I have a very simple clock that displays the time in New Zealand (where I will be going), but it only display the time correctly for GMT+1 right now. If a client from New Zealand or US connects, they will see the wrong time :/
Any way to fix this?
So right now i use:
Code:
newtime = timedate.getSeconds() + 3600*11;
timedate.setSeconds(newtime);
Obtaining An ActionScript 2 Variable From ActionScript 3
Probably one of the most subjects on this forum has to be ActionScript 3 and ActionScript 2 communication. I found several threads on how to communicate between the two using a LocalConnection class, but there is one problem with this approach - I can't transport any values with it. Because LocationConnection.send doesn't have a return type, there is no way to transport a value from AS2 to AS3. This is very unfortunate, as I need to have access to a value that is set somewhere in the AS2 code.
I could use JavaScript as a middle layer to communicate the data between the two, but this will be a very ineffective way to achieve it. Are there any better ways for doing this?
EXTREMELY URGENT - Creating Global Variables Using Names Of Other Variables...
I have variables xtile and y tile within a movie, and I need to create a global variable that will tell all other movies that this particular movie is situated on tile [xtile][ytile], so I need to know how to create the global variable: _root.objectmovie_xpos_xtile_ypos_ytile = true;
I know how to create global variables, and how to have other movies read them, but how do I actually create a VARIABLE with this name? I tried set ("_root.objectmovie_xpos_" + xtile + "_ypos_" + ytile") = true, but that doesn't work (which I kinda knew already but thought I would give it a shot)
any ideas peeps?
please help, its vital to a project I am doing
cheers all
My Variables Load With LoadVars...how Do I Execute A Loop To Assign Variables?
I have 52 (one for each week) duplicated MCs, a loadVars(), and variables "sermonTitle" and "airDate," which I'm trying to assign with the following:
this.airDate=_root.loadContent["airDate" + sermonDate];
this.sermonTitle=_root.loadContent["sermonTitle" + sermonDate];
which is placed in an onClipEvent (enterFrame) handler of the button which is duped . The vars load when I click Video > 2001.
The vars loaded have values named sermonTitle1, sermonTitle2, etc. and the same for airDate. The numbers attached reference the sermonDate which has already been assigned though my duplicateMovieclip loop:
num = 52;
ystart = b._y
n = 1;
while (n <= num) {
duplicateMovieClip("b", "b" + n, n);
setProperty("b" + n, _y, ystart + n*17);
this["b"+n].sermonDate = n ;
trace(this["b"+n].sermonDate);
n = n + 1;
}
I've tried attaching the assign code to the dupMovieClip loop:
num = 52;
ystart = b._y
n = 1;
while (n <= num) {
duplicateMovieClip("b", "b" + n, n);
setProperty("b" + n, _y, ystart + n*17);
this["b"+n].sermonDate = n ;
this["b"+n].airDate = "airDate" + n;
this["b"+n].sermonTitle = "sermonTitle" + n;
trace(this["b"+n].sermonDate);
n = n + 1;
}
setProperty("b", _visible, 0);
and it works - as far as assigning the correct value to the correct button, but it does not associate the loaded vars with them.
The SWF is VERY sluggish, though, which makes me think the onclipEvent is not the best way of assigning vars. I get the trace(this) showing all of the variables loading, so I know that's not the problem.
Does anyone know how to best assign these? I have been advised to use a loop for it. How would I go about executing a loop for this, as I will have navs loading in different text files - Thanks
Link to SWF:
HERE
Virtual Student Yrbook: Variables>Arrays>Variables? SOMEBODY RESCUE ME
Hello, All.
I am totally stumped. I am creating a student virtual yearbook, which displays students names with pictures. I cant find a totally understandable tutorial that teaches me how to extract variables from an array. So I created an asp file that writes out all of the student records to different variable names, and load them using loadvariablesnum(). Using this ASP file works, but once I click the exit button to take me back to the front page, it is as if all of my other variables are erased.
I dont completely understand levels when it comes to loading variables, so everything is loaded like this
loadVariablesNum("http://10.0.1.2/tp/tpod/processGet_studentInfo.asp", 0, "GET"); --- "POST" gives me the same results...
To view the pictures you would click a button on SCENE 4, and it takes you to "VIEW STUDENTS PICTURES" - SCENE 11. 'EXIT' sends you back up to Scene 4, which runs an ASP file which simply grabs a message that is updated every 30 minutes. What Level would I use here??? I have tried many.
Everything works beautifully until I exit the VIEW STUDENTS PICTURES page from Scene11
I've written a pretty sizeable file that uses lots of variables.
I am pretty sure that the problem is with the ASP file: "processGet_studentInfo.asp" - because when I comment it out, the application works fine.
::::::::::::SUPPORTING INFO BELOW:::::::::::::::
Here are the variables that "processGet_studentInfo.asp" creates:
&varStudent1=Crystal&varImagePath1=http%3A%2F%2F10 %2E0%2E1%2E2%2Ftp%2Ftschool%2Fimages%2FCrystal%2Ej pg&varStudent2=Brandy&varImagePath2=http%3A%2F%2F1 0%2E0%2E1%2E2%2Ftp%2Ftschool%2Fimages%2FBrandy%2Ej pg&varStudent3=Angel&varImagePath3=http%3A%2F%2F10 %2E0%2E1%2E2%2Ftp%2Ftschool%2Fimages%2FAngel%2Ejpg &varStudent4=Cathy&varImagePath4=http%3A%2F%2F10%2 E0%2E1%2E2%2Ftp%2Ftschool%2Fimages%2FCathy%2Ejpg&v arStudent5=Destiny&varImagePath5=http%3A%2F%2F10%2 E0%2E1%2E2%2Ftp%2Ftschool%2Fimages%2FDestiny%2Ejpg &varStudent6=Amber&varImagePath6=http%3A%2F%2F10%2 E0%2E1%2E2%2Ftp%2Ftschool%2Fimages%2FAmber%2Ejpg&v arStudent7=lester&varImagePath7=http%3A%2F%2F10%2E 0%2E1%2E2%2Ftp%2Ftschool%2Fimages%2Flester%2Ejpg&v arStudent8=paul&varImagePath8=http%3A%2F%2F10%2E0% 2E1%2E2%2Ftp%2Ftschool%2Fimages%2Fpaul%2Ejpg&varSt udent9=Ginger&varImagePath9=http%3A%2F%2F10%2E0%2E 1%2E2%2Ftp%2Ftschool%2Fimages%2FGinger%2Ejpg&varSt udent10=Brittany&varImagePath10=http%3A%2F%2F10%2E 0%2E1%2E2%2Ftp%2Ftschool%2Fimages%2FBrittany%2Ejpg &varStudent11=chad&varImagePath11=http%3A%2F%2F10% 2E0%2E1%2E2%2Ftp%2Ftschool%2Fimages%2Fchad%2Ejpg&v arStudent12=jaden&varImagePath12=http%3A%2F%2F10%2 E0%2E1%2E2%2Ftp%2Ftschool%2Fimages%2Fjaden%2Ejpg&v arStudent13=Jami+Lynn&varImagePath13=http%3A%2F%2F 10%2E0%2E1%2E2%2Ftp%2Ftschool%2Fimages%2FJami+Lynn %2Ejpg&varStudent14=kara&varImagePath14=http%3A%2F %2F10%2E0%2E1%2E2%2Ftp%2Ftschool%2Fimages%2Fkara%2 Ejpg&varStudent15=Cody&varImagePath15=http%3A%2F%2 F10%2E0%2E1%2E2%2Ftp%2Ftschool%2Fimages%2FCody%2Ej pg&varStudent16=darla&varImagePath16=http%3A%2F%2F 10%2E0%2E1%2E2%2Ftp%2Ftschool%2Fimages%2Fdarla%2Ej pg&varStudent17=Jenna&varImagePath17=http%3A%2F%2F 10%2E0%2E1%2E2%2Ftp%2Ftschool%2Fimages%2FJenna%2Ej pg&varStudentCount=17&varENDER=1
-----------------------------------------------------------
Here is the meat & potatoes of the ASP file that created this:
oRS.Open "SELECT * FROM STUDENTS", oConn, 2, 3
' Move to the first record
oRS.MoveFirst
'Loop to output all the query results to the document
do while not oRS.eof
' counter to give each record a sequential listing
counter=counter+1
Response.Write "&varstudentname" & counter & "=" & Server.URLEncode(oRS("studentname"))& "&varImagePath"& counter & "=" & Server.URLEncode(oRS("ImagePath"))
' move to the next record
oRS.movenext
loop
'LET FLASH KNOW THAT WE ARE DONE RETRIEVING
Response.Write "&varStudentCount=" & counter
Response.Write "&varENDER=finished"
:::::::::::::::::::::::::::::::::::::::::::::::::: :::::::::::::::::
Please help.
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
Targeting Variables Or Loading Variables In An Array
Ok I need some help
I want to make an drop box button so I can just give it a name and load the variables onto the _root stage and then it will work. So I can make one and copy it to function differently. I also have made a loop that only creates a certain number of boxes depending on the number of entries.
So I have the dropbox,'fruit' and then the loaded variables
eg. _root.fruit1vari = apple, _root.fruit2vari = pear, _root.fruit3vari = tomato
(they're loaded into the level above so I don't need 20 different load variables for one page with 20 dropboxes.
so I want the first box which is a symbol made of a text field and a button to load the fruit1var. This symbol is copied for each drop box but upon creation is assigned a simple id of n = 1
I've tried making the variable link,
buttontext = _root.fruit add n add vari
or
thisclipaddress = getProperty(this, _target)
varaddress = thisclipaddress add n vari
buttontext = varaddress
the lines go together ok but the debugger and text feild shows the whole address line not the variable contained at that address.
Thanks if anyone can help
Caspa
P.S. All of this is eventually part of a database if there are any good tutorials out there please mention them. I haven't found any just yet and I'm getting desperate. Or even an explanation on how to get a cgi script to convert the data flash sends it into an SQL query.
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.
Split Variables Multiple Times Into Different Variables
say you have the string: "tilisamazing" - how would you split that into
var 1 = til;
var 2 = is;
var 3 = amazing;
i know you can do this with substr, but what if you dont know the starting and finishing points???
i have seen people split a variable with a comma... how would u do that for this?
Pulling URL / Get Variables OR Environment Variables
If I have a flash file being called from index.html with GET variables at the end ( index.html?next=nextfile.html ) how can I have flash ( i'm using flash mx ) parse these variables so I can use them?
Or is there a better way to pass it variables, maybe in the <param> tag?
I have a basic swf that needs to have a back and next. My back will be a javascript history back button, and my next needs to read a URL from _somewhere_... The easiest way for me would be to pass it in the url, or in a <param> tag.
Thank you, in advance, for your gracious help!
Have a great week.
Adding Variables To Variables In An If Statement
I have a variable named 'Position' which is collecting numbers from various positions, and changeing = 1,2,3 etc.
I want to add 'Position' with its value to other variables:
Sentence, SentenceAnswer ets as seen below.
I have tried as you can see, but it does not work, can anybofy help.
function CheckAnswer(){
if (Sentence+'Position'==SentenceAnswer+'Position'){
_root.Feedback+'Position'=Sentence+'Position'+Corr ect;
}
Cheers
lee
Help: Passing Variables (180 Variables) To Function
hi
if i have call function like this
Math.findMax(app1, app2, app3, app4, app5, app6, app7, app8, app9, app10, app11);
but the values i have to app180
i don't want to write all this
Math.findMax(app1, ... , app180); //!!??
how i can to called the function from app1 to app180
Math.findMax(FROMapp1, ... , TOapp180);
thanx
Variables Holding Variables For ASP - Here's The File. HELP
Hey ALL,
I've created a real simple file to use as testing and have included it here. The basic idea is this.....
The green button in this file upon user click will assign the first variable [send_lv.param1] to be passed to an asp file as [active].
on(release) {
send_lv.param1 = active;
}
The second "red" button will assign a variable [stepVar] to equal "red" and then also trigger the function "yep" to execute.
on(release) {
stepVar = "red";
yep();
}
Yep simply makes [active] = [stepVar] with a trace for testing.
var myUrl_str:String = "mypage.aspx";
var send_lv:LoadVars = new LoadVars();
var load_lv:LoadVars = new LoadVars();
load_lv.onLoad = function(success:Boolean) {
if (success) {
// sendAndLoad processed successfully!
} else {
// sendAndLoad had an error
}
};
//send_lv.sendAndLoad(myUrl, load_lv, "POST");
function yep() {
active = stepVar;
trace(send_lv.toString());
}
The idea being there would be more than just "red" and a string of variables could be made active with more than one "green" button. I would than pass the whole string to an asp file that would accept them.
Thing is, this seems to work if the user clicks the sequence twice. Open the file test it by clicking the green button and then the red. The trace will come up empty the first time but will be correct if you click the green and then red the second.
Any help would be fantastic!!!!
Thanks
-jub-
Declare Variables AS2 Verses Variables AS3
Hello,
I am fairly familiar with Flash, however, I have just recently taken a class in ActionScript 2 as I had no experience whatsoever working with ActionScript. I now have a basic knowledge of how it works, however, I have Flash CS3 and so when I have tried declaring a variable with code like I learned from AS2, it doesn't work. I have perused through the "variables" section of AS forum files and have yet to figure it out. Is there something else that I need to add to the code? I realize you can still write AS2 code in CS3 but I'd like to learn AS3 as well.
For example...an instance of Circle called mcCircle1 is on the stage. So in my code, I write:
var mcCircle1:MovieClip;
When I trace mcCircle1 this is the error message that comes up in the "Compiler Errors":
1151: A conflict exists with definition mcCircle1 in namespace internal.
Am I just missing something simple here?? I'm confused... :$
Thanks,
Terri
Load Variables, Remembering Variables
I am trying to load variables from a text file, and have them available from then onwards in the movie, globally so to speak.
While I can read the variable values in a loader function which executes when the text file is loaded, I don't seem to be able to keep those variables available afterwards.
How do I that? Isn't AS3 wonderful? :(
John
Attach Code
var urlRequest:URLRequest=new URLRequest("index.as3.txt");
var urlLoader:URLLoader = new URLLoader();
urlLoader.dataFormat=URLLoaderDataFormat.VARIABLES;
urlLoader.addEventListener(Event.COMPLETE, urlLoader_complete);
urlLoader.load(urlRequest);
var sspColourBG;
function urlLoader_complete(evt:Event) {
trace("During: " + urlLoader.data.extColourBG); // returns correct value
}
trace("After: " + sspColourBG); // returns undefined
External Varibles, Pathing Varibles, Targeting Variables OMG I HATE VARIABLES
I'm making a movie.
this is the idea. 5 buttons - identical - all text based - basically they're MCs, with the instance state changed to 'button'.
on clicking, each button will open a new window, loading a URL. (this is the easy part)
the text on each button is dynamic and contains 2 text fields.
the first text field is the title.
the second text field is the descrition.
so you have 5 indentical buttons, each will have a title=description.
each title, and each descrition is a variable called from a text file. (eg, title1, title2, title3, desc1, desc2, desc3 etc).
now I can make 5 different MCs, each containing 10 dynamic txt fields, each of which calls a specific variable, but I don't want to hard-code.
Any ideas on how I can do what I want to?
http://www.7inone.info/dls.swf
this is a static version of what I want. I'm gonna upload it in a minute.
thanks in advance
sid.
Finding Variables With Variables
Hi
im building a flash site with a XML based menu and dynamic text content...
In the first frame i load a text file: loadVariables ( " content.txt " , _root ) ;
My problem is that when im press a menu button, it makes a variabel, now i need some code to get that variabel to display, the text.
Ex.
pressed button: _root.label = menu1
if label eq. menu 1 display menu1-text
but becouse its all dynamic the code will get its variables from the XML code wich generate the menu...
Hope its understandable...
Martin Andersen
[MX] Using Variables To Call Variables...
I have this in an external file that I load into a LoadVars object called PunDataFile... Feel free to roar out with laughter, they are belters.
Code:
&NumberOfPuns=3
&pun1text=What did the fish say when it swam into a wall?....Dam!!!
&pun2text=10 cows in a field, which one is an arab?.....Coo 8!!!
&pun3text=Field full of cows, which one is on holiday?....The one with the wee calf!!!
I want to pick out a random pun from the 3 or however many I have as dictated by the NumberOfPuns variable at the top.
Now I'm trying to do it using the following code....
Code:
trace(PunDataFile."Pun" + Math.ceil(Math.random()*parseInt(PunDataFile.NumberOfPuns)) + "Text");
Now I'm asking here because, obviously, it ain't working.
Could someone point me in the right direction or if there is a slicker way of doing the above, I'm open to suggestion.
Many Thanks
Assigning .txt Variables To Other Variables?
Hello- can you please help me-
I have a .txt file with my content in it which is being loaded into the swf through loadvariables. One of the variables defined in the .txt file is 'bronzeOne'. I can bring 'bronzeOne' in fine to the swf and display it in a text box (just letting you know that works), but what I want to do is assign the data in 'bronzeOne' to another variable (not text box) defined in my .fla file. It isn't working! My script looks like this-
clientoptions.txt file:
&bronzeOne=<p>blah blah blah</p>
.fla file-
loadVariables("clientoptions.txt", this);
boptionOne = bronzeOne;
Can you see that I am trying to make 'boptionOne' equal the data in bronzeOne? Why isn't it working though? The other wierd thing about it is that if I assign the same script to a button-
on (release) {
boptionOne = bronzeOne;
// and do some other stuff with other variables
}
It will work fine then! It only works when I activate with it with something, but I want 'boptionOne' to have the data in 'bronzeOne' when you first open the page. I have been trying for hours to fix this and it is probably something really easy and stupid that I am doing wrong, but it would be great if someone could help me please.
I know that one way to fix this would be to just display the 'bronzeOne' data somewhere and then let 'boptionOne' equal whatever is in that text box, but I don't want to display 'bronzeOne'- I want to pass it to another variable and do stuff with it.
Rephrase: Using Variables Within Variables
please help me get some sleep..
how can i make this work?
First Frame:
var number= 1;
var url = 'Pictures/photo'+number+'.jpg'
My 'next' button:
on(press) {
number = number+1;
content.loadMovie(url);}
Problem: button loads 'Pictures/photo1' and not photo2 as i would like.
To be able to use the next button for multiple functions i have to have my url variable set up the way i have it. how can i make var url use the new value for var number?
Variables Refering To Variables
Hi.
I am attempting to do something a bit strange, and I suspect it isnt possible...
Lets say I have an input text box and a submit button.
I want the user to be able to enter anything, absolutely anything into that textbox and when submit is clicked flash will search to see if there is a variable that matches what is in the textbox and if there is, the contents of that variable are displayed, if not then a message is displayed stating that there is not.
for exmple if there is a variable my_variable=127 and the user types in my_variable then flash returns 127.
Now I know how to do all of this except get flash to look at whats in the textbox and treat it as the name of a variable.
the reason i want to do it like this is so new variables can be defined in a text document (so anyone can add to it without having to edit in flash).
So is this even remotely possible? variables that contain variables? my head hurts!!!
Variables/Variables Loading
Hey I am having troubles with my loadvariables and would highly appreciate any help.
SO basicall i have a movie set up. Theres a movie under the root called content, that contains all the animation of the content for the page. Under the content movie is a movie called homecontent, home content contains a movie called dynamictxt which i will use for scrolling, inside of dynamictxt MC is my dynamic txt feild, The Variable that i set for the Dynamic Txt Feild is txt
so my code goes like this inside the dynamictxt MC i have 2 layers one wiht the txt feild and one with the scripting my script goes as fallows.: _root.content.homecontent.dynamictxt.loadvariables ("home.txt")
now inside home.txt I have &txt=hello guys this is my string and for some reason it isnt showing up on my SWF
And for some reason it doesnt display the txt. I have the character set as all characters, and the wrapping settle to multiple lines, and the font color is black while the background is grey.I have the Home.txt saved in the same file as the swf. if anyone knows whats up or if anyone is willing to take a look at the FLA that knows what there doing cause its a complex movie please respond. Mike.
|