Retrieving Variables
Anyone know how to pull a Lasso (or PHP) variable into flash MX 2004?
FlashKit > Flash Help > Flash MX
Posted on: 01-14-2004, 02:12 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Retrieving Variables
In my flash application, I have 3 main sections where there are 3 lots of questions and puzzles, the data for these sections are retrieved from 3 individual java servlets.
Implementing the first two worked fine, however when I came to call the 3rd servlet for the 3rd section of questions, flash went into a looping frenzy and wouldn't retrieve the data, although the data was being sent (I'm sure of this through debugging).
Is there is a limit of information flash can retrieve and store because when i reduce the amount of information being sent to flash in the 3rd section, it works perfectly? (bearing in mind i'm not refering to an incredibly huge amount of data.)
Also would you recommend I split these sections into external swf's then load them one at a time, or is this just amounting to the same problem in the end.
Any help or advise would be really appreciated!!
Retrieving Variables
Hi,
If i have a swf on _level0 and i load another swf onto to _level1 how do i go about passing variables.
For example i set a variable in the swf on _level0 like:
code:
var old_id = 1;
How do i retrieve this var so i can use it again in my other swf on _level1?
Cheers
Retrieving Variables From PHP.
Hi! I've just started to learn AS3 and I found out that I had to use some new methods to retrieve data from PHP. And now (of course) it doesn't work
My AS3 code looks like this:
Quote:
//Create the URLLoader instance
var myLoader:URLLoader = new URLLoader()
//the data will come as URL-encoded variables
myLoader.dataFormat = URLLoaderDataFormat.VARIABLES
//Load using an URLRequest, even beeing local
myLoader.load(new URLRequest("http://magnusvs.net/flashgalleri/connectToDb.php"))
//onLoad handler listener
myLoader.addEventListener(Event.COMPLETE, onDataLoad)
//add a listener for the complete event
function onDataLoad(evt:Event){
if(evt.target.data!=""){
trace(evt.target.data["id0"]);
}
}
The structure of the string that the php code echoes is like this:
Quote:
&id0=1&navn=asdasd&id1=1&navn=dffhr
When I run the AS3 code, I get this error code:
Quote:
Error: Error #2101: The String passed to URLVariables.decode() must be a URL-encoded query string containing name/value pairs.
at Error$/throwError()
at flash.net::URLVariables/decode()
at flash.net::URLVariables$iinit()
at flash.net::URLLoader/flash.net:URLLoader:nComplete()
If I remove
Quote:
myLoader.dataFormat = URLLoaderDataFormat.VARIABLES
and just trace
Quote:
evt.target.data
(not a specific variable), I get the entire output, but just as a string ofcourse...
Does anybodt know how I can retrieve separate variables/being able to loop through the output variable by variable?
Help With Retrieving Variables
Hi ! I am a VisualBasic .Net programmer and on my new program I want to retrieve data in flash (data that is sended through visual basic). For example I want to make a dynamic text in flash having a variable (Var: dataVar). I am able to change that value trough visual basic for example making the variable 1 or 2, but what statement do I have to write so that flash always reads that value and causes a command (in this case i want the stage framerate to change everytime the variable changes, for example if I send the variable 1 from visual basic the stage framerate should be 10 fps, if I send 2 from visual basic the stage framerate should be 20 fps, and so on). I am also having difficulties in using the stage.frameRate command in actionscript 3.0. Highly appreciated if you could write the code for me or if there is a more simple way for doing this. Thank you.
Retrieving Get Variables
gooday, its me again :)
i dont know if anyone asked that question
given a URL passing some get variables such as
http://mysite.com/mypage.html?myGetVar1=blar&myGetVar2=blarblarblar
mypage.html embbed a mypage.swf
(please note that mypage.html, not mypage.swf)
how can i retrieve without using any thirdparty component/script??
especially flash var and swfObject
thankyou
Retrieving Variables From Php..
okay, so i kinda understand how to POST to my php file from a flash-form
but could someone give a quick example of the other way round,
how to set up variables in a php-file and read them from an AS-file
sry, php-noob
thanks /bon
Delay In Retrieving Variables
i'm fairly experienced with php / mysql, but pretty new to flash. i'm working on a game that relies heavily on a database and so far i'm not having too many problems integrating the flash with php / mysql (i've been using AMFPHP for this), but i keep running into one problem. i'll make a call to the database to retrieve a variable, then tell the flash to go to some other frame which uses the variable...
because the time between frames is miniscule and the time it takes to actually get the variable out of the db and return it generally takes a second or two, the frame will load and the variable is undefined. to kind of counteract this, i've made a frame called "process" and in the code for that frame put the code:
if ( var==null ) {
gotoAndPlay("process");
} else {
gotoAndStop("nextFrame");
}
for some reason this doesn't always work, and sometimes it advances to nextFrame even while var is still null... to deal with that i added the line
if(var==null) { gotoAndPlay("process"); }
to the top of nextFrame.
while this solution seems to more or less fit... i doubt it's the best way to go about it. and seeing as how this is going to be a fairly large project, with A LOT of calls to the db (like, inbetween every single frame) this doesn't seem to be very practical. are there any other solutions? thanks...
Retrieving Variables From A MovieClip
Hiya. I have a movie clip of a clock in my movie, and it contains variables with the current time. I would like to retrieve variables from this movie clip using ActionScript on a frame on the main timeline.
How would I go about doing this? Here is my code for the first frame of the movieclip if anyone's interested:
myDate = new Date();
//dateTextField = (mydate.gethours()+":"+myDate.getMinutes()+":"+myd ate.getSeconds());
myHours = myDate.getHours();
myMinutes = myDate.getMinutes();
mySeconds = myDate.getSeconds();
if (mySeconds<10) {
theSZero = 0;
} else {
theSZero = ""; }
if (myMinutes<10) {
theMZero = 0;
} else {
theMZero = ""; }
if (myHours > 12) {
myHours = myHours - 12;
}
if (myHours == 0) {
myHours = 12;
}
dateTextField = (myHours+" : "+theMZero+myMinutes+" : "+theSZero+mySeconds);
Retrieving Asp.net Variables From Flash
hi there.
I have an asp.net page and a flash page and I'm trying to integrate them. The asp.net page simply creates a string variable and I want to access it from flash as3. I'm using the urlloader class and I've tested the flash file using a simple text file and it works fine. The flash file simply displays the variable in a text box.
When I try to run it with a .net file I get the following message -
TypeError: Error #2007: Parameter text must be non-null.
at flash.text::TextField/set text()
at urlload/::completeHandler()
at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunctio n()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/flash.net:URLLoader:nComplete()
This is the flash code that fires when the urlrequest has been done.
private function completeHandler(event:Event):void {
var loader:URLLoader = URLLoader(event.target);
var vars:URLVariables = new URLVariables(loader.data);
txtVars.text = vars.wardNumbers;
}
...where the asp.net variable is called wardNumbers.
I just don't get it! Any help would be greatly appreciated.
Retrieving Variables From SWFObject
Hi Guys,
I'm pretty sure I'm missing something really basic here. I'm using SWFObject 1.5 and I want to retrieve both the variables that I'm passing in. Obviously the script I've written here only gets the last one in the loop. How do I assign them to their respective variables?
ActionScript Code:
var _soName:String;
var _xmlurl:String;
var flashVars:Object = this.loaderInfo.parameters;
/*
SWFObject variables passed in like this:
so.addVariable("xmlurl","some_string");
so.addVariable("soName","some_other_string");
*/
for(var i:String in flashVars) {
_soName = flashVars[i];
_xmlurl = flashVars[i];
}
txt.appendText("soName = " + _soName + "
xmlurl = " + _xmlurl);
This just gives me the same variable twice.
Thanks in advance.
Passing/Storing/Retrieving Variables
Hi all!
You may have seen posts from me regarding a click & find game I am working on. I have a new question, based on the same project. Here is the scenario:
There are 6 different movies that will be played only once during the game (the pattern or playlist is random based on which button the user clicks 1st, 2nd, 3rd, etc.) Is there a way to pass a variable from each movie (once it is played) to one central container, where they are stored until it is filled with six variables, and when filled it will play a new movie?
I am not very familiar with passing variables, so don't know if this is possible or if this is the right function/approach?
Any thoughts would be greatly appreciated!!!
You all rock!!
Abell1973
AttachMovie And Retrieving Variables Within MovieClip
Hi All,
I'm having a slight problem I'm hoping someone has the answer to.
In one frame I'm attaching a MovieClip to the stage:
_root.attachMovie("Button0004", "newbutton",525);
trace("textfieldx is equal to "+_root.newbutton.textfieldx);
The trace doesn't return a value for _root.newbutton.textfieldx
But when I put the trace on a button and press it afterwards, it returns the correct value.
textfieldx is defined within the MovieClip "Button0004". I would think I would be able to access the value textfieldx as soon as I attach the movie.
Any thoughts on why it's not working directly after the movie is attached?
Thanks much.
Retrieving Variables In Dynamic Text
I have this button/image which changes the dynamic.text variable and takes me to a new scene.
this.onImagePress = function(the_ibox){
_root.dynamic.text="Stuff";
_root.gotoAndPlay("new scene");
}
This takes me to my new scene and changes the dynamic variable to = "stuff" but I don't know how retrieve the data in the dynamic text so I get this code to retrieve dynamic.text data.
img1.loadImage(dynamic.text+"/"+dynamic.text+" ("+(1)+")"+".jpg");
img2.loadImage(dynamic.text+"/"+dynamic.text+" ("+(2)+")"+".jpg");
img3.loadImage(dymamic.text+"/"+dynamic.text+" ("+(3)+")"+".jpg");
A simple question but obviously my know-how has a few gaps.
Thanks
[AS3] Retrieving Variables URLLoader.data
hey, im back with another as3 question
i've been setting up a high score table in my game, and everything is working, but i cant work out how to get variables from the URLLoader.data that im retrieving
if i trace loadedScores.data, i get this
&name1=matt&score1=323250&name2=1234567890123456.. . and so on
i've tried passing it to a URLVariables constructor, but it says the string doesnt contain the correct name/variable pairs or something, and loadedScores.data.name1 doesnt work...
thanks for your help, cant work this one out for the life of me
cheers
ERROR Retrieving Flash URL Variables
Hello, I am working on a flash movie for a client and I have not used flash much before at all.
Reading many tutorials online I have come up with the following two files.
I have the object/embed code here below with the following src path sos.swf?wID=5.
I need that wID so when I load certain variables from a php page later on in the movie I can access that persons information (wID correspons to the primary table key).
HTML Code:
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"
WIDTH="383" HEIGHT="180" id="myMovieName"><PARAM NAME=movie VALUE="sos.swf?wID=5"><PARAM NAME=quality VALUE=high><PARAM NAME=bgcolor VALUE=#FFFFFF><EMBED src="sos.swf?wID=5" quality=high bgcolor=#FFFFFF WIDTH="383" HEIGHT="180"
NAME="myMovieName" ALIGN="" TYPE="application/x-shockwave-flash"
PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT>
I then have the following actionscript in my flash movie
Code:
var widgetID = _root.wID;
/* first create a new instance of the LoadVars object */
myVars = new LoadVars();
// call the load method to load my php page
trace(widgetID);
myVars.load("sos.php?wID=" + widgetID);
// once vars have been loaded, we will have these variables:
var var_firstname = myVars.firstname; // "pietro"
var var_years = myVars.years; // "lana"
var var_months = myVars.months; // "pietro@flash-php.it"
var var_days = myVars.days;
var var_minutes = myVars.minutes;
days.text = var_days;
years.text = var_years;
firstname.text = var_firstname;
months.text = var_months;
minutes.text = var_minutes;
I have tried several things and I am not sure just how to access the flash URL variables. To make sure I am putting the action script in the right place I have only one layer, and when I click on that, I enter the actionscript in the actionscript window for that layer. Is that the correct place to put it? I am pretty sure it is but I just want to double check.
The variables.text at the bottom are my dynamic text boxes that are displaying information from the sos.php file.
Nothing is showing up in my movie and I am unaware of good debugging techniques for actionscript. I have tried to trace(widgetID); but nothing shows up in my movie. I am not sure if that is because of the image I have on the screen or what.
Any help to get the URL variable into my movie and then to correctly pass it to my php file would be most helpful. I have hit a brick wall at this point.
By the way here is the part in my php script that sends the variables over. They do have data in them but nothing is being displayed in the dynamic text boxes.
PHP Code:
$vars = "&firstname=".$name."&years=".$totalYears."&months=".$totalMonths."&days=".$totalDays."&minutes=".$totalMinutes."&meals=".$var_meals."&meetings=".$var_meetings."&movies=".$var_movies;echo $vars;
Thanks again for anyone who can try to help me out.
I really appreciate it.
Retrieving .swf
Hi,
I have a .swf on my server but I have, since making it, lost the .fla
Is there a program I can use to turn the .swf into a fully working .fla (preferably without paying )
Thanks
Retrieving Fla From Swf?
Hello...I am in desperate need of retrieving my fla's from my swf's. I learned the hard way that you need to back up your files every day. My hard drive went bad which means I lost all my files on it.
I downloaded flash toolset , but after looking at it I am not sure if it allows you to retrieve the fla from an swf.
Can someone share some ideas of what I can do to reteieve my fla's from my uploaded swf's??? I am desperate for some help here.
Thanks for any help or direction you can share.
Retrieving RGB Value
OK, i know how to use the color.getRGB(), but how can i tranform that into actual RGB values...i can get the hex code using .toString(16), but i want the actual RGB values, for example, white is R:255, G:255, B:255, not #FFFFFF, please and thank you!
Retrieving So
I got my data to be saved via shared object. However when i'm trying to retrieve it, it is not displaying properly in my dynamic txt box here is my retrieving code.
code:
//Retrieve data from the Shared Object
function getData() {
so = SharedObject.getLocal("deviations", "/");
if (so.data.deviationList != undefined) {
calculated_array = so.data.deviationList;
trace("GETTING DATA " + calculated_array);
for (var i = 0; i < calculated_array.length; i++) {
display.text = calculated_array[i];
}
display = calculated_array; //display is a dynamic txt box.
}
}
The only way display txt box is displaying any information is after the for loop not in it. I've created a variable in the for loop above, and traced it out, it traces properly but still doesn't show in my display txt box, yes the txt box variable is display.
Any ideas?? Thanks
Corey
Retrieving A MC's Name From Within...
Hi there.
How can I find the name of a movieclip from within the mc's onClipEvent(eventname)? I know about this, but I need to convert the name to a String to be able to use it.
I would love some help, need it very much.
Kind Regards,
Samuel
Retrieving
Is there any way to bring back a flash document that i accidentally didnt save. I still have the movie saved by the way, just not the project????????
Retrieving
Is there any way to bring back a flash document that i accidentally didnt save. I still have the movie saved by the way, just not the project????????
Retrieving Lost Fla.
Greetings,
I built a cool flash menu for my site but some of the contents have changed.
The problem is that when I reformatted my harddrive I put all of my flash stuff onto a cd rom, after reformatting I found that the cd was corrupt and have lost the fla for the menu.
I do however have a copy of the swf file that I downloaded from my site using an ftp program.
Is there any way to turn it into a fla file or unlock what I did to create it?
Retrieving Framelabel
Hi. Is there an way to retrieve the current framelabel (not _currentframe...)?
Thanks,
Leo
Retrieving Loaded Var Value
i am dynamically loading a text file that has a list of variables. since the amount can vary, i built a "for" statement to create and populate an MC with each variable. that's why i have to target this clips dynamically.
Code:
for (i=1; this["var"+i] != null; i++){
duplicateMovieClip("mc0", "mc"+i, i);
this["mc"+i+".myURL"]= this["address"+i];
}
ok this is where i start getting confused, because for the most part this works. in the dynamic text box (variable "myURL"), it will display the correct value for the corresponding variable. HOWEVER, when i try to retrieve it, ie button press,
Code:
on (release) {
getURL(myURL, _blank);
}
the value returns empty... trace function also shows myURL is empty. but i can clearly see the value in the text box. what's going wrong, and how can i remedy the solution?
thanks
jwt
Retrieving Data
Hi,
I am trying to create a movie where it will take up a text from a location (say some other Text File) and display with animation.
1> How do I link the external file and create this movie?
2> What changes are required if I have to make the text animation same with the text changes? That is, in case I modify the text, how will that affect the animation in the text...
Please help me with this..
Thank you
Wishy
Retrieving 'dynamic ' PNG?
Hello everyone,
In my signature on many forums my signature is my system specs, one of them are:
Quote:
Now this is a dynamic picture, and its updated every minute or so. Is it possible for a flash movie to get this picture for that URL [http://sigx.yuriy.net/images/xlieb39.png] and display it? And also, I’m sure it already does this, just want to make sure, that if it does, than it won't just load it from cache or whatever,thats its new every time?
Edit: Using Flash MX
Thanks,
lieb39
Retrieving A MC Name From A Button Within The MC
VER: Flash MX
Hello,
Im wondering if there is a way to retrieve the name of a movie clip from within that movie clip?
Im trying to make a reusable MC and need to be able to glean the MC name and use it in a query.
There are about 150 MCs with this naming convention:
somevar_mc
someOthervar_mc
andOnotherVar_mc
etc,etc.
The Mc name needs to be available within itself, and would be used like this on a button:
example:
Remove the last portion of this name someVar_mc (_mc) and just use the first part (someVar)
code:
on(release){
_root[varName] = 0;
gotoAndStop("unchecked");
}
Any help would be appreciated..
3PRIMATES
Retrieving _x & _y Via For Loop
Ok, when creating movie clip instances using a for loop like this example, the coordinates (or any other property of the clip) can be read back using a for loop too...
Code:
// Place 5 instances of my_mc on stage, numbered mc1, mc2, etc.
for (i=1; i<6; i++) {
attachMovie("my_mc", "mc"+i, i, {_x:100*i, _y:100});
}
// Retrieve x coordinates of each movie clip
for (i=1; i<6; i++) {
a = getProperty("mc"+i,_x);
trace(a);
}
However, if they are nested movie clips, what is the syntax for getting values back? See this example (which gives an error)...
Code:
// Place 5 instances of my_mc within master movie clip on stage
attachMovie("master", "master", 1);
for (i=1; i<6; i++) {
master.attachMovie("my_mc", "mc"+i, i, {_x:100*i, _y:200});
}
// Retrieve x coordinates if each movie clip
for (i=1; i<6; i++) {
a = master.getProperty("mc"+i,_x);
trace(a);
}
I have tried lots of combinations, like a = getProperty(master."mc"+i, _x);
Retrieving A Var From A Function....
I'm having trouble retrieving a variable from inside of a function....
the function is a php variable loaded into flash with the new LoadVars();
the var in the php script is:
PHP Code:
&title=Your Slogan Here...&
the actionscript is:
PHP Code:
slogan = new LoadVars();
slogan.onLoad = function(obj) {
var a2 = slogan.title;
trace(a2);
obj.retrieve = function(refName) {
var a6 = "sligan.title";
trace(eval(refName));
}
}
o = {};
slogan.onLoad(o);
o.retrieve("a6");
o.retrieve("a2");
slogan.load("getSloganData.php");
when i run the script i get this in the output:
PHP Code:
undefined
sligan.title
undefined
Your Slogan Here...
the first "undefined" comes from inside the function the second "undefined" is generated from "o.retrieve("a2");".
Then i can retrieve the "a6" var no problem...
Finally it traces inside the function with "Your Slogan Here..."
why can't i call this var outside of the function or is there a way to retrieve vars declaired inside of the function
thanks for any quick responses......
[F8] Retrieving Scene Name
This is probably a very easy question, but how do you get the name of the current scene (like _root._currentframe for the current frame)?
Retrieving Data
ive tried searching and using tutorials but they dont seem to work. i just want to get one line of data into the flash file.
ie. my shout.php will echo out 'myVar = abracadara' into a dynamic text which has turned into a symbol. its instance name is word and the variable is myVar.
for some reason, nothing is being read. is there some actionscript i need to use to update the symbol?
Code:
loadVariables("login.php", 0, "POST");
gotoAndPlay(2);
word =this.myVar;
my php is working perfectly, im working with flash mx 2004
thanks,
gg
Retrieving Own File Name
Is ActionScript able to retrieve the filename of its own .swf file.
Example: the swf is called hunter.swf. I need actionscript to get the filename without the extension - "hunter"
Thanks
Retrieving The URL From A Loader
Hi
How can I retrieve the url from a loader. Is it possible?
Thank
here is the basic:
var lien:URLRequest = new URLRequest("pic1.jpg");
var telechargement:Loader = new Loader();
telechargement.load(lien);
addChild(telechargement);
telechargement.contentLoaderInfo.addEventListener( Event.COMPLETE, fini);
function fini(event:Event):void {
//I would like to retrieve the url for pic1.jpg
trace(telechargement.url); // won't work, i tried many others
}
Retrieving Image
hi guys
i need to retrieve an image from the libary in Flash CS3 using actionscript for a skool project, can u show me how or show me a tutorial
thx bruv!
Retrieving Browser URL
Hello,
I'd like to create a SWF file that will be able to play different frames when different links are clicked.
However, I need the SWF file to be independent of the links. That means that the links are sitting on a HTML page. This also means that I need to be able to retrieve the current browser URL. And then depending on the links clicked (URL retrieved), it will gotoAndPlay a different frame when different links are clicked.
I tried movieclip._url but it returns the URL where the SWF is loaded, thus it is of no use (see script below). What is the function I should use?
Please help.
onClipEvent(enterFrame) {
var location = this._url;
if (location == "www.kirupa.com") {
_root.mc.gotoAndPlay(5);
}
Thanks
Glads
Retrieving External Var
Hi,
I am looking for a way to retrieve an external var from within my swf file.
For example, I want to retrieve a var called test whose value is ok
I know that I can pass it that way (GET method):
<param name="movie" value="mymovie.swf?test=ok>
but how to retrieve it under my swf by using as 3.0?
thanks
Retrieving Images Through PHP
Hi, I'm designing a website aiming to provide visual coverage of surfing locations across the UK through the use of webcam images. Each of the images themselves will be retrieved externally, with permission, from various hotels over-looking these locations.
I have spoken to someone who has completed a similar project, a widget which retrieves and displays webcam images, which can be viewed here:
Widget
I would like to use the same method. Explained in his own words:
'The feeds you see in the widget are simply JPEG images hosted on the originating website, so none of the feeds are handled by myself. The widget sends a HTTP request for the JPEG and displays what it gets in the widget.'
As you can tell from the link url, he's used PHP, which I have been learning.
I have lost contact with him recently and not sure the steps I should take to integrate such a feature into my website. Please help!
Retrieving Information From A DB
the following script is behind a button and the script below it is a PHP file. I just cant figure out why i dont get any feedback back into flash in any form. Any help on where i went wrong is greatly apreciated.
Thanks in advance,
on (release) {
code = new LoadVars();
code2 = new LoadVars();
code2.onLoad = function() {
if (code2.entrycode == "1") {
linkinfo == "something is wrong";
} else {
//linkinfo = code2.entrycode;
gotoAndPlay(3);
}
};
if (login == "" or pass == "" or login == "login name" or pass == "password") {
linkinfo = "Input Error.";
bckgrndlayer._visible = true;
stop();
} else {
bckgrndlayer._visible = true;
_root.linkinfo = "Retreiving Data";
code.action = "insert";
code.codex = login;
code.codey = pass;
code.sendAndLoad("retrievecode.php", code2, "GET");
}
}
PHP:
<?
require("config.php");
if ($_GET['action']=="insert") {
$codex2 = $codex;
$codey2 = $codey;
$query = "SELECT logname, logpass FROM tbl_login WHERE logname = '$codex2' AND logpass = '$codey2'";
$result = mysql_query($query);
$numR = mysql_num_rows($result);
}
if ($numR == 0) {
echo "&entrycode=1";
} else {
echo "&entrycode=2";
}
?>
Retrieving XML Attribute Value
Hi folks,
Realllly quick question. How do I go about retreiving the attribute value in the following XML script. In this case "atl" in the first child?
Code:
<?xml version="1.0" encoding="iso-8859-1"?>
<hotels>
<prop id="atl">
<name>Atlantic City</name>
<lowest_rate>129</lowest_rate>
</prop>
<prop id="blv">
<name>Georgetown</name>
<lowest_rate>149</lowest_rate>
</prop>
<prop id="cac">
<name>Miami</name>
<lowest_rate>169</lowest_rate>
</prop>
<prop id="las">
<name>Las Vegas</name>
<lowest_rate>169</lowest_rate>
</prop>
</hotels>
And here's my AS:
Code:
var xmlMe:XML = new XML();
xmlMe.ignoreWhite = true;
xmlMe.load("lowest_rate.xml");
xmlMe.onLoad = function(p_success:Boolean){
trace("::CODE IS SUCCESSFUL::");
//Below is a sample XML path, you will need to confirm
//the correct path for your needs.
trace(this.firstChild.attributes.path);
};
Obviously, my trace isn't bringing up the right value...
Any help would be greatly appreciated!
Flash - ASP --> Retrieving From Db
Hi hope someone can help me, ive searched for the answer but can't solve it, goes like this:
Flash - ASP - Microsoft SQLServer
the part where i send variables to store in my database works fine:
---------------------------
function sendToDb(){
var my_lv:LoadVars = new LoadVars();
my_lv.namn = _root.namn_mc.textRuta.text;
my_lv.texten = _root.texten_mc.textRuta.text;
my_lv.extra = _root.extra_mc.textRuta.text;
my_lv.img = _root.img_mc.textRuta.text;
my_lv.send("http://station/dollhouse/fraga_add_new.asp", "_blank", "POST");
}
----------------------------
But i want to retrieve data from the database as well. I cant do it!! Just keeps saying undefined all the time... tried a many different solutions now but nope.. the last i've tried was this:
function loadFromDb(){
var my_lv:LoadVars = new LoadVars();
my_lv.onData = function(src:String) {
_root.getNamn_mc.textRuta.text = "Magnus rules"; //my_lv.namn
_root.getTexten_mc.textRuta.text = my_lv.texten;
_root.getExtra_mc.textRuta.text = my_lv.extra;
_root.getImg_mc.textRuta.text = my_lv.pic;
}
my_lv.load("http://station/dollhouse/getfromdb.asp", this, "GET")
}
-----------------------------------------------------
the asp code in getfromdb looks like this: (only sending one variable here though)
<!-- #INCLUDE VIRTUAL="dollhouse/includes/funcs.asp" -->
<%
Set conn = getConn
sql = "select * from fragor"
Set rs = getRs(sql, conn, "")
rs.movefirst
response.write ("&extra=" & Server.URLEncode(rs("extra")))
response.flush
rs.close
Set rs = Nothing
closeConn(conn)
Set conn = Nothing
%>
And the database connection in funcs works and so on... cause the asp-side gets the info out of the db but Flash cant get it from asp..
PLZ help me!!
Retrieving The Last Btn Pressed
Hi,
I have a problem on a code!
It's probably simple :
The principle is to fade in and fade out 3mc upon 3 buttons
i have 3 buttons :
btn_1
btn_2
btn_3
and 3 mc with fade in and fade out tweenings inside:
frise1_mc
frise2_mc
frise3_mc
for example i want to click on btn1 and fade in the mc1 but also if the btn2 was pressed before i want to fade out the mc2 which is already on the stage.
It's seems to work the first time but after the movie clip disappears.
Here is the code:
stop ();
var previousBtn:Number=0;
function fonduFrise (number) {
_root["frise"+number+"_mc"].gotoAndPlay ("in");
trace("btn just pressed = "+number);
_root["frise"+previousBtn+"_mc"].gotoAndPlay ("out");
trace("previous btn pressed =" +previousBtn);
previousBtn=number;
}
btn_1.onRelease=function () {
fonduFrise (1);
}
btn_2.onRelease=function () {
fonduFrise (2);
}
btn_3.onRelease=function () {
fonduFrise (3);
}
Would be great if someone can see what is happening.
Thx a lot.
You can view the swf and the fla here in the zip
Retrieving The Value Of A Variable
Ok,
first of all, I'm not a flash programmer. I'm just trying to modify a script.
said that. I've a form which uses two movie clips as form-fields and I'm trying to make this work. I wanna when the user press the button "send", my flash retrieves the value of these two fields and then send to the webpage. The "sending" part I think is easy. The problem is that I cannot retrieve the value of these fields.
Probably its really easy for you guys, but not for me. As i'm not a flash programmer. Here's the code I'm using to test. It returns null:
Code:
on (release) {
trace("password: " + passwd );
}
Now, here's the debug screen (I did a "Find" for all "passwd" occurences):
Code:
Movie Clip: Target="_level0.instance56"
Variable _level0.instance56.passwd = "testing123"
Edit Text: Target="_level0.instance56.instance57"
hscroll = 0,
htmlText = "testing123",
length = 10, tabIndex = undefined, html = false, selectable = true,
type = "input",
background = false, scroll = 1, backgroundColor = 16777215, condenseWhite = false,
border = false, textHeight = 14, borderColor = 0, thickness = 0,
textWidth = 70, mouseWheelEnabled = true, wordWrap = false,
antiAliasType = "normal",
variable = "passwd",
sharpness = 0, embedFonts = false,
text = "testing123",
filters = [object #71, class 'Array'], maxhscroll = 0, maxscroll = 1, textColor = 7500402,
autoSize = "none",
restrict = null, bottomScroll = 1, password = true, maxChars = 20,
styleSheet = undefined,
gridFitType = "pixel",
multiline = false
so the value is there "testing123" how to get this?
thanks!
Retrieving Data
I'm still having trouble with a simple bit of coe, I'm pretty sure that its down to my stupidity more than anything else but he goes:
I have an array with data in it, its a multidimensional array with unknown dimenstions, the data I want is in the 1st element. The data should call a function once rearranged here is what i have so far
ActionScript Code:
var tempObj=new object
tempObj.name=this.arr[0].shift //separates the name of function to passing data
tempObj.args=this.arr[0]//passes the arguments over
this[tempObj.name](tempObj.args]
alas it doesn't and I cannot find a viable workaround either... any ideas?
Zen
Retrieving Name Of Currently Playing FLV
I want to find out the name of the FLV video that is currently playing, and when I saw this:
The NetStream.Play.Start and NetStream.Play.Failed information object also have a details property, which is a string that provides the name of the streams being played.
on the adobe site, I thought it would work, but it says it is undefined, when I print out whatever the content of the infoObject.details is.
Any ideas?
Thanks.
Retrieving Values From XML
Hi guys,
Just going through and teaching myself some AS3 and getting data from an XML file.
At a basic level im able to access the XML and then output it to a text field. Now Im trying to pull out all the Name fields, from the XML, of which in my sample there are 2.
When I do a trace() it outputs the 2 values Though when I attempt to spit them out to a text field I only get the last value printed..
Im using a For loop as below:
Code:
var xmlLoader:URLLoader = new URLLoader();
var xmlData:XML = new XML();
xmlLoader.addEventListener(Event.COMPLETE, LoadXML);
xmlLoader.load(new URLRequest("http://wwwdev/_tools/parties_act.xml"));
function LoadXML(e:Event):void {
xmlData = new XML(e.target.data);
ParseDivInfo(xmlData);
}
function ParseDivInfo(divInput:XML):void {
// Create new XML list
var PartyNameList:XMLList = divInput.DivisionInfo.PartyName;
for (var i:int = 0; i < PartyNameList.length(); i++)
{
var nameElement:XML = PartyNameList[i];
rawXML.text = nameElement;
trace(nameElement);
}
}
XML file
Code:
<divisions>
<DivisionInfo>
<ID>101</ID>
<Name>Canberra</Name>
<State>ACT</State>
<CandidateID>17614</CandidateID>
<CandidateName>Annette</CandidateName>
<CandidateSurname>ELLIS</CandidateSurname>
<PartyName>Australian Labor Party</PartyName>
<PartyAb>ALP</PartyAb>
</DivisionInfo>
<DivisionInfo>
<ID>102</ID>
<Name>Fraser</Name>
<State>ACT</State>
<CandidateID>17613</CandidateID>
<CandidateName>Bob</CandidateName>
<CandidateSurname>McMULLAN</CandidateSurname>
<PartyName>Liberal</PartyName>
<PartyAb>LP</PartyAb>
</DivisionInfo>
</divisions>
Retrieving Hidden Field Value
Hi,
I am trying to retrieve a value in a hidden field and display it in flash can anyone help. Basically I have an html page with a hidden field and value and I want to be able to retrieve it and display it in flash can anyone help please.
Any help is much appreciated
Retrieving Server Time?
Hey people,
I have a flash site which alters its state depending on the time of day in this particular city. Only the time I retrieve is currently off the users puter.
The site is hosted on a server here in our city, so I really need to retrieve the time off the server. Is there a method for this??
Cheers
Brucha
|