ActionScript 3.0 :: Loading External Data (dynamically)?
Jun 21, 2011
I am trying to load dynamic data into text fields with in flash (.swf) the system is a closed circuit (no internet & web access) basically there are about 10 standalone computers connect through a network and one central computer i created a flash which will be downloaded to all the computers at once and each computer has a unique (name).My goal is to load the different data into the text field for each computer:Computer 1 would have winner 1 Computer 2 would have winner 2and so one........Steps the code should do..1. call function and load the "unique (name)."of the computer by going to("c:/myharddrive/local.ini"); flash will reconize the "ini file to say "this is computer 12. then have the txt request come from("c:/CMS/MediaFiles/Data2.txt");when i publish the file out there is no errors-When I view the files on each computer there is no data (blank screen")so my guess it is not seeing the path for newURLRequest("c:/myharddrive/local.ini");r new URLRequest("c:/CMS/MediaFiles/Data2.txt");can anyone breakdown the code and let me know how flash can go to those specific areas on each individual computer and pull the data into flash
Essentially, I've got a MC container that's created dynamically based off an XML file (basically for every <title></title> I've got, it makes a new "card"). Now within the context of each <title></title> grouping I've got <imgs></imgs> in which I specify the path to images that are related.All of that works perfectly, save for the external jpg files actually appearing on the stage. The MC I add them to does, but the external image doesn't.My problem is- I can't add the external images until they're completely loaded (or so it appears). The thumbnail BG I use is blank. So I know for a fact that the thumbnail BG isn't occluding the loaded thumbnails.
I have a project where I need to use XML to dynamically load PNG and GIF files not just JPEGs. I have found forums and information from 2004 of users complaining about the capability not being available but since then we now have Flash 8.
I'm loading a XML to Dynamic Text field and all is OK, but the SWF is show at left out site of the flash document, I only want put a icon and a text in the same line, something like this: <body><img align="left" src="icon.swf" width="15"><mess>You have 4 new messages</mess></body> I try with many kinds of tags, CSS and attributes and nothing.
I have built a horizontal scroller, you can see images there that go from left to rigth, what I wanted to do is when a user clicks on a thumbnail:
1)go to full screen mode
2)create an empty movie clip and load a jpg into it
I did it, but when I go back to the normal screen the empty movie clip is still there. How can I get rid of it when the user goes to the normal screen? it seems to be that when I load the jpg into the emptymovieclip the empty movie clip doesn't have the click property is that true?
I have a website which needs to load 3 external images into 3 movieclips when the page loads. The page gets the URLs for the 3 images from an XML document, ie.
I work at this place that does tons of partner sites for our main company, that all the same site, just with different color schemes and logos. i'm in the middle of redoing a lot of the elements and making them flash based. i realized if i can have a way of maybe dynamically loading the colors on the page from an external php or xml document, that i would save myself and other much work in the future.
I am undergoing a huge flash project at the moment and as wondering whether or not an approach would work for something. Basically everything in the project involves loading data and movie clips dynamically in certain arrangements etc. I have built everything already bar a couple of things to create demos including dynamically loading mcs from the library etc all with as3, but now I am moving on to loading data dynamically and before I immerse myself completely I was wondering whether or not something is possible. Basically as I mouse over an mc i want a couple of things to come up which would be held in a database, such as a question and an answer, but this data will change quite frequently when the demo is up and running, is it possible for the data to be updated in the dynamic text boxes without mousing out and mousing over again? That is one of my concerns ( I have a couple ).
I had thought of maybe using a timer to query the database every 2 to 3 minutes and use php and mysql with as3 to then load the data into the text boxes, hopefully without having to mouseover the mc again and simply leaving the cursor over the mc the whole time. My main concern is whether or not I can query the database on a regular basis... using a timer method as described above, or is this simply stagnant data? i.e. can i use php and mysql in as3 to continuously query a database?
I have a Main.swf that loads an external Child.swf, also the Child.swf loads some external files. My problem is that once the Main.swf loads the Child.swf. The paths that Child.swf reads (for it's external files) are no longer normal and it reads the paths from the Main.swf. (Main.swf is in another folder). Is there a way to lock the paths of the child.swf dynamically from the Main.swf?
I am attempting to load text from an external .txt file into dynamic text fields using AS2When you click on a button (named forward and back), I want the next &-denoted "news" item to repopulate the current dynamic text boxes to replace the first bit of info.This is what I have so far, but I'm stumped. I used the trace to make sure the button is "clicking" (it is), but I can't get the integer to go up a number and repopulat the fields.
var newsData:LoadVars = new LoadVars(); newsData.load("data.txt"); newsData.timeline = this;
Is there a way to load an XML file if it's on a differen server/domain than the html/swf file? I already set allowScriptAccess="all" but it didn't seem to help.
Having done loads of it in the first few years of this century, I've not done much Flash in the past few years, been focused on PHP/MySQL Development. Anyway, I now need to use the data from a MySQL database offline in a Flash executable so I'm jumping back in with AS3. There are several tables involved and I can write a script to export the data to whatever format is best.
XML or CSV? Should I get it all into one file with all the data or is it possible to do the quivalent of joined queries once the data is in Flash? I don't need a full explanation at this stage,
I built a simple application to load XML data using a external XML file. However, the link I am using will have a different Presentation ID each time a user creates a presentation. So some how the presentation ID needs to be know before I actually load the XML file at least in my mind it does. Is there a way to load the URL dynamically or set my url loader up so it loads whatever ID there is?
I have an external text file that will have two variables and look like this:&months=January,February,...&days=Sunday,Monday,.. .I am using loadVars to load the textfile in. When it is done loading, I want to load each of the of the 2 variables into an array so I have an array for months and array for days
Ok, lets see if i can explain this right. I have been trying to make a movie that loads different information from an external file each day. I name the external files according the the date that i want it to be imported (example: 200667, for today)Ive been able to make the .getYear(), .getMonth(), .getDate() work to make the date in the above formatxmlData.load(" ");<-- now when i write in the url to load the external file is there a way that i can write it so that it will update itself to the correct date so that i dont have to update it manually myself?
I have a pretty CMS that generates an XML and I want to make part of the site loading that data (menu items, thumbs, info, and big pics) is there an way to make all that using for?here is my XML code
recently i have tried loading external icons dynamically into my vertical carousel using XML and the icons got loaded successfully into the carousel ... but once they are loaded the entire processor is getting consumed ( even though its a decent config ) and the animation is becoming sluggish ... i've tried and searched the net for a solution but i couldnt find one related to this... i just used actionscripting in my .fla and no tween ( in the main timeline or the movieclip in the library) ...
var numberOfItems:uint; var xmlPath:String = "intro.xml"; var xml:XML;
I have a bit of a problem finding the correct syntax. I have a whole lot text variables here. The myLV value is in a external text file. So myLV.nr1 from my external textfield is loaded in ovrnr1.text. This way I can easily change the value in my text document.
If I put it like this it works fine but I thought, hey, in stead of writing 150 of these I can put it in a for loop. So I tried this.
for (i=1; i<150; i++) { ovnr[i].text = myLV.nr[i]; }
However, this does not seem to work ? And could I do it to a button too ? So instead of writing 150 button onrollovers I could also make a loop for it ?
Something like for (i=1; i<150; i++) { this.btn[i].onRollOver = function() {
[URL]when i test the site on my computer with flash it works. when i upload to the internet the xml data is not picked up. when i had the xml data in the same subdomain it worked both on my computer and in the internet...but i need the data to be accessible...
i have tried adding cross domain "policy files" for permission, but either they are not working, or i am doing it incorrectly...
i have been given two sources for a weather data feed:
[URL]
i would like to 'load' the text similar to loading xml i have seen several articles on reading variables from .txt but they all suggest the .txt file needs more formatting - whilst this one is just seperated by lines.
I am having a problem with loadMovie(); I have a button that loads external SWF into a container, but when another button is released loading a different SWF into same container, that SWF twitches and doesn't load properly.Is there a way to cancel an external SWF from loading during the load process? Or is there an easier way to prevent this using onLoadProgress(); with a while loop?And I am some what new to listeners and loadProgress(); programming
it took me so long to write this tutorial Well, here I go... Section 1: Introduction So you want dynamic content on your Flash movie. Sounds simple, right? Well let me tell it is, and well, it isn't. This tutorial assumes a basic knowledge of Actionscript, PHP and MySQL. If you have that, it's time to move on. Otherwise, I recommend you do some reading on the subjects... Section 2: Setting up your SWF to receive external data Loading external data into an SWF is a fairly simple task. Although the external text file method is probably the most widely known, it is by far the clumsiest way to get data into your SWF. Of course, this may be your only option of your server doesn't support MySQL/PHP! But for those of us who are fortunate to have these privileges, let me show you how Flash can get external data without having to create additional text files.
Dynamic text fields In order for Flash to get data from an external source, you need to make use of dynamic text fields. Simply place a blank dynamic text field on the stage and make sure you give it a variable name (NB: dynamic text fields have both an instance AND a variable names. In this case we want to focus on the variable name). Note the name you give to the field's variable name, as we'll need it when we write our PHP script. Once you have a text field setup, convert it to a movie clip symbol. Attach the following code to the resulting movie clip:
When retrieving external variables from the server URLVariables my Flash get stuck on first compilation values. Whenever I update server values flash compiles the first old values. Only after i restart CS4 IDE values are updated. Is there an internal cache?
There is nothing wrong with my code, because it works fine on my mac, but not on pc.
What is the best way to work large amounts of external data in Flash? XML, remoting,something else??I'm looking into a project that has a lot and I'm not sure what the best way to handle it would be
spot the error here that is giving me a TypeError: Error #2007: Parameter text must be non-null.The text field captions are in a file named captions.txt in the same root folder.
Code: var myURLLoader:URLLoader = new URLLoader(); var myURLRequest:URLRequest = new URLRequest("captions_tuesday.txt");
Possible to load an array from a external data source. I.e. like from a .txt file? I tried putting this in the external text file: mytest = new Array("dadada") It loaded, but not as a array, just as text. I am using LoadVars.
I have been working on a Flash movie that loads variable data from an external XML file and dynamically displays the item names in a menu which may then be clicked to display other dynamically-loaded content that corresponds to the menu item that was clicked. I have now come to a standstill in the project as there is something I'd like to achieve but simply cannot work out how. This is my first attempt at working with XML in Flash and one of my early attempts at using variables. What I'm trying to achieve is; once the user has viewed the item's content, they can simply click "next" and "previous" buttons to display all of the content for the next or previous items in the XML document.
I know it probably sounds simple and I'm sure some of you could achieve this in 5 minutes (!) but I can't get my head around some of the coding. I assume previousSibling and nextSibling would come into play here as well as some sort of functions which access arrays of data for the previous and next items, but I'm just not sure how to correctly put these things to use. Rather than post my code and example images of the stage up here on the forums, I've created an html page here: [URL]
I'm trying to load data from an external text file into an array. I created an array and am able to load the data into an array if I explicitly say something like
I can then do a trace statement on array[0] and it will output the correct name from the file. My problem is I'm trying to iterate through the variable names in the text file in the file by using an index variable. This is the code I'm using after doing all the URLloader, URLRequest, and so forth stuff:
All three of those also give me errors. For the first one the trace statement outputs "undefinded" instead of "Doug". For the second I get "syntax error. Expecting identifier before left bracket". And for the third I get "syntax error, expecting identifer before uid.":
syntax to iterate the number after uid(uid1_name, uid2_name, uid3_name, etc)?