ActionScript 3.0 :: Loading Info Variables And Arrays From A Webpage?

Mar 31, 2011

I am trying to load variables from my webpage onto my .swf

ActionScript Code:
var loader:URLLoader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.VARIABLES;
loader.addEventListener(Event.COMPLETE, loading);

[code]....

This code works perfect for loading variables in a &var1=1&var2=2& etc...But how can I load variables from the page?like do I need to put in &array_name[incrementing_var]=value& and then when i go to access it it should be loader.data.array_name[0] but this doesn't work for me? I realize my URLLoaderDataFormat.VARIABLES is for variables but can i still pass arrays with this? or do i need a new format? or do i need to pass the values as variables and convert them into an array in my AS?

View 5 Replies


Similar Posts:


ActionScript 3.0 :: Send Info To Back To A Webpage?

Jun 9, 2009

I've been using flash vars to send info (such as numbers) into a swf file. I need to send info back to the webpage. something as simple as a interger (maybe, send as a "GET", like in a forum) if you could give me some sample code, or some keywords to look up

View 9 Replies

ActionScript 2.0 :: Pushing Variables To Arrays Within Arrays?

Jun 25, 2004

correct syntax for pushing variables to arrays within arrays? I have searched many threads but found nothing that exactly answers my query.I have a class (Brigade) which amongst other variables contains an array (BrigadeUnits) This is the third element.. My Brigades are stored in an array called AllBrigades. I now need to fill the BrigadeUnits array with objects of my Units class.The hierarchy I want to create is as follows:

AllBrigades (array of Brigades)
Brigade (object)
BrigadeUnits (array within Brigade object)
Unit (Object to be stored in BrigadeUnits array)

I have tried various approaches including the following, assuming that I am addressing the first Brigade in the array:

AllBrigades [0] [2].push (MyUnit);

But when I trace this I just get undefined.

View 14 Replies

Send Variables From A Php Webpage To Flash Animation?

Jan 13, 2011

I am searching how to send variables from a php webpage to a flash animation that it will be integrated into anther webpage ... Little exmple : An user enter his name in an input in a php page then when he clicks submit button his name will be shown in a flash animation

View 2 Replies

ActionScript 2.0 :: Internet Variables - Change The Value Of A Variable On A Webpage

Nov 7, 2008

I have been using AS2 for a while now but am having some trouble when it comes to the internet side, I basically would like to be able to change the value of a varible on a web page or something and use this value on a different computer, like an mmorpg but it does not have to be that fast, I have looked around and am having trouble working it out, I know you can use servers and stuff but I don't want to have my computer running 24/7 so someone else can use it.

View 1 Replies

ActionScript 2.0 :: Problems With Arrays And Variables

Nov 14, 2006

Hello all,

I am having some weirdness with arrays and variables. I'm sure this is something basic but I can't get it to work. I have a an MC name "circle" this also contains dynamic text field name nameMC. Writing to that textfield is simply circle.nameMC.text = "New copy";

So below I have two arrays.


Code:
var textArray:Array = [one, two, three];
var newArray:Array = ["one", "two", "three"];
for (var i:String in newArray) {
this.attachMovie("circle", newArray[i], this.getNextHighestDepth(), {_x:Math.random()*300, _y:Math.random()*200});
textArray[i].nameMC.text = newArray[i];

}
This doesn't work. I've tried swapping the various arrays but no luck. So why does the movieclip want to use the "quoted" array value and not the unquoted. Also, when I use"


Code:
one.nameMC.text = "hello";
everything works fine, but the arrays won't. So:


Code:
textArray[i].nameMC.text = "hello";
for example doesn't work.

Thanks for any guidance!

View 3 Replies

ActionScript 2.0 :: Make Arrays As Variables?

Dec 26, 2006

why cant the variable "height" modify the position of y? =S im new at ac so i dont know if an element of an array can be a variable? and how do i make it a variable?this is a par of the code im writing to make a group of movieclips appear offstage in a random positions as long as it is offstage (i know the array is not random since i give the values of each element but i tried by putting y= math.random * number?... but in the coordinates i didnt knew how to specify that it could be any random number exept the lenght of the stage)

onClipEvent (load) {
myArray = new Array ();
myArray[0]=-100;

[code].....

View 8 Replies

ActionScript 3.0 :: Name Arrays With Variables (strings And Integers)?

Apr 21, 2011

i want to choose one of these randomly, I have a loop way in which there is a loop searching for the index number which is inside an array like M1[1]=1 , M2[1]=2 and if I have a random number between 1 and 20 I can loop the arrays [1] element.
 
But is there another way with directly get the random array buy name. For example I have the random number 14 which directs me to M14. how Name of the array help me to choose M14 when I have the number 14....

View 2 Replies

Flash - Loading Info Per Enter Frame

Jul 21, 2011

I want to make a loading bar but at first I need to have loading info per enter frame. This is how I do it but it seem not working.
var mapLoader : Loader = new Loader( );
var mapLoaderInfoLoad:Number;
var mapLoaderInfoTotal:Number;
public function engine() {
[Code] .....

View 3 Replies

IDE :: Flash Setup - Loading Name And Other Info From Database

Jun 27, 2009

I have a page display people's name and when you click on a name information such as age, height, and weight are displayed. In Flash, can you create the same thing? I know with displaying data from a database you have to have dynamic text boxes set up to load the info but can you have it set up so you can load a name from a database and THEN click that name to have it load the other info?

View 1 Replies

ActionScript 1/2 :: Object Variables (arrays), Persisting To A New Keyframe?

May 4, 2009

After unexplainable problems with external class files, I'm trying another way of doing what I need to do:  an Object variable declared in the fla file. Well, this has its own set of problems. The big picture is:  I need to get user data and populate fields in their profile when they sign on.  Then save changes to their profile during the session, add new users and make changes to their profiles.  Pretty normal stuff.
 
Here's the problem I'm having with the object.
 
Frame 1  Script:
 
/* Define the object to use as an associative array.*/
var Person:Object = new Object();// Define a series of properties.Person.HomName = "Joe";Person.HomEmail = "joe@gmail.com";
  
Then go to a new keyframe, where I have my fields that need to be populated
 
Script:
 
EnterName.text = Person.HomName;EnterEmail.text = Person.HomEmail;stop();
  
When I compile, I get this error twice (once for each field) "The property being referenced does not have the static attribute."
 
What does the mean and how do I fix it?
 
Here is a link to the source file if you care to look.
 
[URL]
  
The only way I've been able to get variable data from one script to another is through a _global.variable.  Is this the only way?  No arrays or objects vars?
 
Thanks in advance for all who assist.  Some day soon I hope to be able to return the favor!

View 3 Replies

Copying Arrays - Instance Variables - Multiple Animations?

May 17, 2009

- I tried, when I first started making this site, to load all of the artwork images into an array and then copy the array before resizing them for their specific functions (being seen as thumbnails or as full size pics.) Unfortunately, I ran into the well known issue of Array cloning only creating a pointer to the same group of items. I tried the newArray = oldArray.slice() trick, but it didn't seem to work. Finally, I just loaded the images twice into two separate arrays, and it works, but I hate this solution. Anyone got a better one?

- I'm trying to maintain some sort of connection between the two sets of Arrays so that, for example, when someone clicks on Thumbnail 15, Fullsize Image 15 will open up but I couldn't find anything that worked. Renaming the Instance Name dynamically didn't seem to work and adding an Instance Variable dynamically doesn't seem possible either as I can't make the Class I am working with (Sprite, in this case) dynamic ahead of time. I'm sure there's a simple method for this.opens up, the different animations seem to interfere with each other and slow each other down (they also seem to get interference from the time taken to load the image Arrays.)

View 9 Replies

Professional :: Separate The String And Push The Different Variables Into Their Appropriate Arrays?

Mar 8, 2012

I have a string variable that looks something like this:

2012-03-07 135.06 135.91 134.93 135.69 143616800 135.69
2012-03-06 135.35 135.43 134.36 134.75 202129900 134.75

It continues like this, a list of reoccurring variables seperated by spaces, for a few more lines.How can I separate the string and push the different variables into their appropriate arrays. The end result should look like this:

dates = [2012-03-07, 2012-03-06]
variable1 = [135.06, 135.35]
variable2 = [135.91, 135.43]

View 10 Replies

Arrays :: Saving X And Y Cords As Variables On Mouse Click?

Jan 7, 2012

I have a piece of code worked out that creates circles on a mouseDown function. I'm trying to save the x and y cords of the circles but cannot figure out a way around this. I need to save multiple instances of the cords from mouseDown.

Is it possible to do this in an array?

var posOne:Number;
//var posTwo:Number;
//var posThree:Number;

[Code]....

View 2 Replies

ActionScript 3.0 :: Way Of Reducing Amount Of Code / Using Variables And / Or Arrays

Feb 4, 2012

I have got the sound functionality working for two sounds in my embedded movie clip, each controlled by their own on-off button.I need to add this for another 20 or 30 sounds in the movie clip.I have the feeling there is a way of reducing the amount of code here using variables and/or arrays.

View 1 Replies

ActionScript 2.0 :: Redeclaration Of Variables - Wipe An Arrays Content?

Jan 17, 2004

Say I made var $temp[] an array and put stuff into it, could i then redeclare temp as var $temp = 4 or maybe var $temp[], another array, but completly clear? or would it hold a risidual? If not is it possible to wipe an arrays content? In java we used to dump and drop variables all over the place, a string could be an integer, then a char, then a float or a double at a whim.

View 5 Replies

CS3 Loading From DVD/Webpage

Apr 6, 2009

i'm working in CS3, with AS2

I'm taking a website i put together, and plopping it on a DVD.

There are 3 parts to it.

One, is the flash .exe, which brings up a small splash page with general info on me. At the bottom there are two links to webpages i made. I would like to keep all the websites files ON the DVD, and not have the end-user need to have an internet connection, although in these times, i guess i could get by that way.

2nd part, is the webpage's main page. The main page contains a flash frame, in which there are six buttons, each with AS(2) looking to a folder on the DVD, to bring up another URL in the same window. Ru:


Code:
on (release) {
getURL("D:/main/1/index.html","_self");

weird thing is, this works when on the hdd, but as soon as i put it on the DVD and try to run it from there, the main page doesn't connect/open the link I specified. I've also tried it:

Code:
getURL("1/index.html","_self");

and that doesn't work either. i'm not if i'm missing something small, but if need be, i can post a chopped down zip or rar with the files needed for someone to take a look at.

View 3 Replies

ActionScript 2.0 :: Preloader SWF Setup - Loading Images / Info

Oct 8, 2007

I'm about to make a preloader of sorts, but have run into a problem because I have multiple SWFs being externally loaded in different locations. [URL]

As of now, it's setup like so:
Main.swf - has the scrollbar, loads body.swf into scrollbar container
Body.swf - has the layout, buttons, etc. Loads illus_finished.swf, illus_sketchbook.swf, etc.
illus_finished (and all other work files).swf - dynamically loads XML and images/info.

So basically, its one big swf that loads the content swf. The content swf loads the work swf's - which load the xml, images/info. I think I might load all the swfs from one file somehow, but I'm having trouble targeting into MC's of loaded swf's.

Should I set up a preloader swf, and somehow preload all the swfs into the browser cache? (I dont know how to do this, esp since I'm loading into a target, and not a level#) This way I wouldn't have to change how my movie is setup.

Should I take all the loading instances out of all my files and load them all from the first movie - and stick the preloader in THAT file? I can't figure THIS out, either, because I can't seem to target movieclips in loaded SWFs.

View 1 Replies

ActionScript 2.0 :: Associative Arrays - Store Variables And Change Values

Dec 18, 2007

I'm trying to use associative arrays to store my variables but am looking for a solution to change the value of array1[i] to array2[i]. Since it's an associative array, the only way I know how to loop through these kinds of arrays is by the following:
Code:
for(var i in array1) {
trace(array1[i];
}

What I would do when using indexed arrays to change the value of array1[i] to array2[i] would be something like this:
Code:
for(i=0; i<array1.length; i++) {
array1[i] = array2[i];
}

However, I can't see any way you can do this with associative arrays because they do not have a numbered index such that in a loop you could
say array1[i] = array2[i] .
So I'm looking for a way to do this with associative arrays.

View 14 Replies

ActionScript 2.0 :: Dynamic Slideshow - Loading Images Using XML Info From Array

May 25, 2009

I've constructed a dynamic slideshow using ActionScript 2.0 and PHP/MySQL. The reason for this, aside from update purposes, is that the slideshow will eventually display over 200 images. Thus, to save loading time and bandwidth, I decided to use PHP to pull ten images from an SQL database, formatting the output in XML. The slideshow itself works fine. Unfortunately, there are a couple of issues I need to address; my ActionScript is extremely rusty, so much of my work's patchy.

The code's displayed below:
import mx.transitions.Tween;
import mx.transitions.easing.*;
var myShowXML = new XML();
myShowXML.ignoreWhite = true;
myShowXML.load("getData.php");
[Code] .....

The code in red is my main focus. It's the loop which loads all images as movie clips using the XML information from an array. The loop loads all of the images, making them transparent before the presentation begins. What I would like to do instead, to save loading time, is to load the next image while the current one is displaying. The function "moveSlide" controls the transition of the images, so I'd imaging it'd be best to plade it in there.

There's already an incremental variable being used, with _root.target_mc, for removing transparency from the current slide. The code in blue is also nagging me quite severely. I retrieve the next chain of slides by simply contacting the PHP script again. The only way I could think of doing that was to refresh the slideshow (this is done COMPLETELY in ActionScript, with nothing on the stage). Unfortunately, I could only work out how to reload the whole video.

View 1 Replies

ActionScript 3.0 :: Getting Error Info On URLRequest When Bulk Loading Images

Feb 18, 2010

I'm using a bulk image loader from FlashAndMath. The code has you send a list of images to load and it simultaneously attempts to load all at once, adding each load req to a list.

My problem is that when one doesn't load and throws an error, I don't know which load request failed. Are there built-in ways to get it to report what image it was trying to load, or at least which of the load requests threw the error? I tried doing an event.contentTarget.content.name and it reports an instance #, but not the name I tried assigning when I called the URLRequest.

View 6 Replies

ActionScript 2.0 :: ScrollBar Dragger To Be Positioned In Relation To The Info._y As The User Scrolls Info?

Jun 24, 2010

I have some scrolling content (info). I've also made my own scroll bar.I want the scrollBar dragger to be positioned in relation to the info._y as the user scrolls info.I have created two vars: one that worsk out where info._y is as a percentage and the other that works out where the scroll._y dragger should be as a percentage...

Actionscript Code:
var scrollBarPercent = Math.round(scrollBar.dragger._y / [code]........

also onMouseWheel working too.I need a small bit of code that takes the % of info._y and moves the scrollBar dragger to the same % but in relation to the Stage.height...so if projectGalleryPercent = 50%, make dragger._y 50% of Stage.height using scrollBarPercent.

View 1 Replies

Flash Movie Does Not Loading In Webpage

Nov 3, 2010

I found a flash movie on the internet and I modified it to meet my needs and works perfectly, but when I uploaded to my website it doesn't load correctly: it should have load the spiral carousel photoslide but instead it loads only the background photo. The flash movie is inside a folder with all the flash files included including the actionscript files, I uploaded that folder to my website and in my index.html page I've put my flash movie.

View 3 Replies

Loading A Webpage Within A Flash Document?

Dec 26, 2009

load a webpage withing a flash document,
 
this is what i want to happen, i want the flash to stop animating/looping (i already have that done) and then instead of opening a seperate page to load a website i want it to load within the swf. CS4 ActionScript 3

View 2 Replies

ActionScript 3.0 :: Loading External SWF On Webpage

Mar 25, 2012

So here's our project hosted by our school. [URL] We dont have a preloader so you have to wait til it's loaded. After the dialogue, you will enter the first GAME (training phase). We call it MEMORY MATRIX. The game is an external swf so it is expected that it will load right away after the button is clicked. The problem is it wont function the way it is expected to and the sound wont load also.

Actually we have 6 external SWFs all in all to be loaded by the main swf. 2 external sounds and 2 external JPEGs and memory matrix is just one of the external files. The paths are correctly set. There are no sub folders. The index.htm is placed together will all the files needed for the game. If I run this using my files here on my desktop, it functions well.

View 1 Replies

ActionScript 3.0 :: Loading A Webpage In Flash?

Oct 21, 2009

I am trying to load the contents of a web page into flash, however I keep getting undefined when I trace the data. For example:

var api:URLLoader = new URLLoader();
api.dataFormat = URLLoaderDataFormat.TEXT;
api.load(new URLRequest(this._api_url + 'logged_in?key=' + this._api_key));
trace(api.data);

It points to the right address, why isn't my data loading though? Do I need to have a crossdomain policy?

View 2 Replies

ActionScript 3.0 :: Loading A Webpage Within A Flash Document?

Dec 26, 2009

is it possible to load a webpage withing a flash document,this is what i want to happen, i want the flash to stop animating/looping (i already have that done) and then instead of opening a seperate page to load a website i want it to load within the swf

View 1 Replies

ActionScript 1/2 :: Method Of Loading External Webpage?

Apr 20, 2010

What method is used to load a flash web in to another flash webpage? Something like Iframe do in HTML. Will loadmovie do it?

View 3 Replies

ActionScript 2.0 :: Loading External Webpage In Flash Swf

Oct 21, 2010

Is there any way I can load external webpage (eg. [URL] or [URL]) in flash swf using actionscript2.0?

View 1 Replies

ActionScript 1/2 :: Loading Xml Into Separate Arrays?

Apr 15, 2009

The first two records of my XML file are below these are two of about 100.
 
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><coursesSummary><courses><year>2009</year><quarter>1</quarter><region>Central Courses</region><coursecode>3634500</coursecode><coursetitle>Bancassurance(BIP) 2- Selling Skills Course</coursetitle><coursesrun>1</coursesrun><maxplaces>10</maxplaces><numberattended>9</numberattended><splitbyregion>no</splitbyregion>

[code]....

View 7 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved