Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash








AS2: Accessing A Shared Object's Data


I'm trying access the data in a shared object by using the following code. Unfortunately, it keeps giving me "undefined." TempSavedData() runs when the swf loads to set the data (which is really just a placeholder at this point).


PHP Code:




TempSavedData = function() {
    savedata = SharedObject.getLocal("SavedData");
    savedata.data.SavedData1 = "Hello World";
}

MyButton = function(xpos, ypos, layer, num) {
    this.clip = attachMovie("MyButton_Load", "SavedData" + num, layer, {_x:xpos, _y:ypos});
    this.clip.onPress = function() {
        var t = this._name;
        var dump = savedata.data.t;
        trace(dump);
    }
}




FlashKit > Flash Help > Flash ActionScript
Posted on: 01-09-2008, 06:17 AM


View Complete Forum Thread with Replies

Sponsored Links:

Accessing Shared Object
If in an SWF file I create a shared object like this
var so:SharedObject = SharedObject.getLocal("name");
and sore some value in it
so.data.my_value="my_value"

Then I load another swf into this swf, can I retreive my_value?
I.e. can I access so from the loaded file?

View Replies !    View Related
Netscape Browser Not Seeing Shared Object Or Accessing C:/Program Files
HI
I have a password protected file (swf inside an html) that uses a shared object. It works great on IE but not on Netscape.
Can anyone help?
I tried also on Mozilla firefox and it picks up the shared object but reduces all my swf files int he html down to a very small size (even thou I put 100% in the HTML code width/height!!).

I am about to try on Opera and then the mozilla ordinary version in a mo and hoped that it is a simple html issue but thinking its more than that for the shared object side of things....

can anybody shine any light on any of these?
ta.
Shaf.

View Replies !    View Related
Data From Shared Object - Using Elsewhere
Hi all,

I have a dynamic text field on the stage which loads the data from my shared object (a word). This works great but I'd like to get my movie to jump to a certain label depending on what that word is. For example if the shared obeject puts "Jump" into the dynamic text field I'd like the movie to jump to the label "Jump".
I have tried a number of ways to do this including using an "if" statement etc, but can'tget it to work.
Do I need to convert my data (which is a string) into a variable or something before I can make the jump or is there a easier way.


__________________
Thanks in advance

Sambora

View Replies !    View Related
Shared Object, Parsing Data, XML
Hello,

Someone mentioned I should look into shared objects since I want to have data stored locally through a flash interface. I found one example and got it working. Now I want to take the next step.

1) Are there any useful Shared Object methods I should be aware of?

Is it possible to put a list of values within 1 variable and then have Flash parse these values into designated sub variables? For example, I am trying to find a way to organize names of stations. Let's use band names instead. The main variable could be "B", for bands starting with the letter B. If someone adds "Beatles", and then "Beach Boys", I would like to have those two in the B variable, but I also want to assign them to their own variable, B1 and B2. Furthermore, is it possible to alphabetize so that "Beach Boys" is assigned to B1, not B2, even if it is added second?

2) If possible, how can I best parse data?

This now leads me to XML. I hear a lot mentioned about it, but so far a regular .txt file and now .sol file is sufficient enough now to add and read data.

3) What advantages would there be to integrate XML into what I have mentioned above, and do you think it is worth it?

View Replies !    View Related
Looping Through Shared Object Data
Hello,

I'm trying to build an abstract shared object read function and I'm trying to treat the shared_object.data object as a regular array but it doesn't respond as such.

Here's what I'd like to see happen or something similar:

var shared_object = SharedObject.getLocal("user_data");

//--- read the contents of the shared object ----
for( var i:Number = 0; i < shared_object.length; i++ )
{
trace( shared_object[i] );
}
//-----------------------------------------------------



Thanks for your help,
Clem C

View Replies !    View Related
Shared Object Data Available For Others Swf In The Same Page?
Hello people,

sorry about the nooby question, but i wantted to know:

are flash cookies with a shared object available for others swf (not the original one who created it) liying on the same page?

if its posible, how can i retrive the data i stored from another flash?

thanks a lot.

View Replies !    View Related
Looping Through Shared Object Data
Hello,

I'm trying to build an abstract shared object read function and I'm trying to treat the shared_object.data object as a regular array but it doesn't respond as such.

Here's what I'd like to see happen or something similar:

var shared_object = SharedObject.getLocal("user_data");

//--- read the contents of the shared object ----
for( var i:Number = 0; i < shared_object.length; i++ )
{
trace( shared_object[i] );
}
//-----------------------------------------------------



Thanks for your help,
Clem C

View Replies !    View Related
Loop To Add Data To Shared Object
Hi,

I'm working with a shared object, and I'm having trouble dynamically adding to it. I want to create a data variable for each list of names (ex: nameLists_so.data.list1, nameLists_so.data.list2, etc.), but do it through a loop.

Here's the code I tried, but didn't work....


ActionScript Code:
nameLists_so = SharedObject.getLocal("listOfNames");
for (i = 0; i < allLists.length; i++) {
  nameLists_so.data.list[i] = allLists[i].names
  trace (nameLists_so.data[i]);
}

allLists refers to an array with the names of the lists (ex: list1, list2, list3).
names refers to the array within each list, that has the actual names.

Any help would be great, thanks!

View Replies !    View Related
Shared Object Data Usage
I am using the shared object to store data from one swf on a cd to hold it for the next one and so on to a total of 4 files on separate cds. It seems to be keeping the data as needed, but I also want the user to be able to print out the data at the end of the 4th file. I have set up the print function, but it is only capturing the data that was created in the 4th swf. How do I use the data from the shared object to enable printing those variables as well?

View Replies !    View Related
Removing Data From A Shared Object
Does anyone know if it's possible to remove an array property and its values from a Shared Object?

For example, if the SO contains the following:

elemArray_1: 56-02-136,136Ba,Barium,93.0
elemArray_2: 18-03-40,40Ar,Argon,>99.999
elemArray_3: 51-02-123,123Sb,Antimony,98.2

How can I delete "elemArray_2" entirely? - Rather than just set the individual values to undefined? (I would then refresh the display by reading the updated cookie props)

View Replies !    View Related
Loading Data From Shared Object-Doh
Hi guys,

I'm trying (and failing) to save and reload data from a shared object. I can create the object and save data to it so long as I keep the file open. My problem is accessing the data again when I re-open the program. I created the shared object using:

var DataStore:SharedObject = SharedObject.getLocal("DataStore");

write an array to its data property using:
DataStore.data.PlayerStore=PlayerStore//saves my array

and use DataStore.flush(); to save data persistently.

My problem comes in reloading the data. I guess I don't want to do:
var DataStore:SharedObject = SharedObject.getLocal("DataStore"); again
because that would overwrite the original data ,so I check to see if DataStore still exists and holds data by making the creation of the shared object conditional upon its prior existence:

if(DataStore.data.PlayerStore==undefined) {

var DataStore:SharedObject = SharedObject.getLocal("DataStore");
}
else{
PlayerStore=DataStore.data.PlayerStore;
}

This fails to load any data. Any ideas out there? I've checked out all the tutorials and they are a little vague on how to load data once you've closed the program down. This has stopped me in my tracks for a week and its doing my head in!

View Replies !    View Related
Why Is My Shared Object Data Not Being Read Back In?
ok i have two functions, one that gets/creates the local shared object, and one that saves data to the shared object:

get/create the SO:

Code:
function getUserData (){
_global.userData_so = SharedObject.getLocal("JTIA");

trace("xml = "+_global.userData_so.data.courseInfo_xml)

if (_global.userData_so.data.courseInfo_xml == null){
//if there is no course xml data on the shared object, create a new one
_global.userData_so.data.courseInfo_xml = new XML();
//create the root <Courses> element
_global.userData_so.data.courseInfo_xml.appendChild(_global.userData_so.data.courseInfo_xml.createElement("Courses"));
_global.userData_so.flush(10000);
trace("_global.userData_so.data.courseInfo_xml = " + _global.userData_so.data.courseInfo_xml)
}
}


saving the data:

Code:
function saveUserData(){
_global.activeTrack
_global.activeCourse

//shortcut var to the SO xml object
var ci_xml = _global.userData_so.data.courseInfo_xml;

//check to see if an element for the current course already exists
//in the sharedobject's xml file

//search through the child nodes of the main element
//to try and find a matching element for the current course

var main = ci_xml.firstChild;

var num = main.childNodes.length;

for (var i=0; i<num; i++){

//check to see it
if (main.childNodes[i].attributes['id'] == _global.activeCourse){
trace ('element '+ _global.activeCourse +' found');
//now that we have found a match for an existing course,
//we need to loop through this element's children to find a matching track number
for (var j=0; j<main.childNodes[i].childNodes.length; j++){

if (main.childNodes[i].childNodes[j].attributes['id'] == _global.activeTrack){
('track '+ _global.activeTrack +' found');
_root.saveProgress_mc.gotoAndStop("already");
return;
}

}
('track '+ _global.activeTrack +' NOT found');
//if we havent found a matching track element, we need to create one
var newEl = ci_xml.createElement("track");
newEl.attributes.id = _global.activeTrack;
newEl.attributes.complete = "true";

main.childNodes[i].appendChild(newEl);
('track '+ _global.activeTrack +' added');
_root.saveProgress_mc.gotoAndStop("success");
return;
}

}


//if it doesnt, create an element for the current course and save the current track
trace ('element '+ _global.activeCourse +' NOT found');
var newCourse = ci_xml.createElement("Course");
newCourse.attributes.id = _global.activeCourse;

var newTrack = ci_xml.createElement("track");
newTrack.attributes.id = _global.activeTrack;

newCourse.appendChild(newTrack);

ci_xml.childNodes[0].appendChild(newCourse);




var save = _global.userData_so.flush();
if (save){
_root.saveProgress_mc.gotoAndStop("success");
trace ("data saved successfully")
trace("_global.userData_so.data.courseInfo_xml = " + _global.userData_so.data.courseInfo_xml);
return;
}else{
_root.saveProgress_mc.gotoAndStop("error");
}
}


ok...everything appears to work fine...the shared object is created but doesnt have any elements, so the results of those two traces after i flush the SO are:


Quote:




data saved successfully
_global.userData_so.data.courseInfo_xml = <Courses><Course id="ETH0047"><track id="1" /></Course></Courses>







which seems to be exactly what i want.

Now, the next time i run the swf, the trace from the getUserData function is:


Quote:




xml = <Courses />






what is going on here?

View Replies !    View Related
Loading Shared Object Data From Another Swf Movie
Hello!!!

i have a little time testing the shared object flash include to save data on the user computer. im actually working on a proyect that requires that for its development.

im using the shared object to save the session of the users logged in on my site, at this part everything is ok. the trouble comes when i try to call the data stored on the shared object from another swf, residing on the same web page. it just brings nothing.

i have weeks reading and researching everything i could to solve this situation, but anything seems to help me.

please, can anybody tell me, how can i call the data on a variable saved on a shared object from another swf, (not the original one who creates it)?

thanks...

View Replies !    View Related
Shared Object Complex Data Structres
Hi,
I am looking for a workaround on how to store an array of objects within a shared object.

myArray contains an object with 5 properties derived from my custom class.

Obviously it would be lovely to just bind my sharedObject.data.myArray = myArray;

What would be the best approach to achieve this?

Many thanks.

View Replies !    View Related
Adding Data To Remote Shared Object
Hi guys

Can you still add data to remote shared objects from the client in AS3?

T

View Replies !    View Related
Saveing Text Data To Shared Object
ok First off I am new to scripting...
I have been trying to create a quiz like function that will remember your answers to email them at the end. I have been able to create variables for the Login, but I cant get those to write to a shared object to save it. Can anyone help with this


ActionScript Code:
var login_fname = "Type Login Name";
var login_pswd = "Type Login Password";
// Create an SO
LoginSO = SharedObject.getLocal("quiz_data");
// Add some expendible data
LoginSO.shortLived = "Woe is me, the short lived variable";
// Add some important data
LoginSO.data.stickAround = "I'll be here for years to come!";
LoginSO.data.stickAround2 = login_name;
LoginSO.data.num = 123;
LoginSO.data.obj = new Array(4, 5, 6, 7);
LoginSO.data[login_name] = login_name;
// Write the SO to the disk (I'm not checking for success here)
LoginSO.flush();
// Delete the SO
delete LoginSO;
// Load the SO back in
LoginSO = SharedObject.getLocal("quiz_data");
// Scan the SO for values
for (a in LoginSO.data) {
 trace(a+": "+LoginSO.data[a]);
}

And yes a lot of the code is from a tutorial from this site

View Replies !    View Related
Shared Object Data & Movie Clips
I am now able to use shared objects in MX to store user input (via input text boxes) and then display this in dynamic text boxes. This information will also save so that the next time the user visits the activity, their info will be recalled.

I have now stepped up a bit and want to pass the same information onto a dynamic text box which is contained within a movie clip. I cannot get the shared object data to move into a movie clip container for the dynamic text box.

Can anyone take a look at my .fla file and / or suggest what I could do?

It can be downloaded at: http://www.munzamedia.co.uk/3-3-4_test.fla

Thanks

View Replies !    View Related
Looping Through Shared Object Data Prop
I'm trying to loop through each of the arrays stored in a Shared Object and place the individual array items inside rows of textfields. This isn't quite working - it fills all the text fields with the last data array only:


Code:
var elemSharedObject:SharedObject = SharedObject.getLocal("elementChoices", "/");
//Load data into fields
for (var prop in elemSharedObject.data) {
for (i=1; i<prop.length; i++) {
table_mc["p"+i+"_lb"].text = elemSharedObject.data[prop][0];
table_mc["i"+i+"_lb"].text = elemSharedObject.data[prop][1];
table_mc["el"+i+"_lb"].text = elemSharedObject.data[prop][2];
table_mc["en"+i+"_lb"].text = elemSharedObject.data[prop][3];
}
}
I need a way to increment "elemSharedObject.data[prop]" after it's filled each successive row of textfields. Any help would be appreciated.

View Replies !    View Related
Why Is My Shared Object Data Not Being Read Back I
ok i have two functions, one that gets/creates the local shared object, and one that saves data to the shared object:

get/create the SO:

ActionScript Code:
function getUserData (){
    _global.userData_so = SharedObject.getLocal("JTIA");
   
    trace("xml = "+_global.userData_so.data.courseInfo_xml)
   
    if (_global.userData_so.data.courseInfo_xml == null){
        //if there is no course xml data on the shared object, create a new one
        _global.userData_so.data.courseInfo_xml = new XML();
        //create the root <Courses> element
        _global.userData_so.data.courseInfo_xml.appendChild(_global.userData_so.data.courseInfo_xml.createElement("Courses"));
        _global.userData_so.flush(10000);
        trace("_global.userData_so.data.courseInfo_xml = " +  _global.userData_so.data.courseInfo_xml)
    }
}


saving the data:

ActionScript Code:
function saveUserData(){
    _global.activeTrack
    _global.activeCourse
   
    //shortcut var to the SO xml object
    var ci_xml = _global.userData_so.data.courseInfo_xml;
   
    //check to see if an element for the current course already exists
    //in the sharedobject's xml file
   
    //search through the child nodes of the main element
    //to try and find a matching element for the current course
   
    var main = ci_xml.firstChild;
   
    var num = main.childNodes.length;
   
    for (var i=0; i<num; i++){
       
        //check to see it
        if (main.childNodes[i].attributes['id'] == _global.activeCourse){
            trace ('element '+ _global.activeCourse +' found');
            //now that we have found a match for an existing course,
            //we need to loop through this element's children to find a matching track number
            for (var j=0; j<main.childNodes[i].childNodes.length; j++){
               
                if (main.childNodes[i].childNodes[j].attributes['id'] == _global.activeTrack){
                    ('track '+ _global.activeTrack +' found');
                    _root.saveProgress_mc.gotoAndStop("already");
                    return;
                }
               
            }
            ('track '+ _global.activeTrack +' NOT found');
            //if we havent found a matching track element, we need to create one
            var newEl = ci_xml.createElement("track");
            newEl.attributes.id = _global.activeTrack;
            newEl.attributes.complete = "true";
           
            main.childNodes[i].appendChild(newEl);
            ('track '+ _global.activeTrack +' added');
            _root.saveProgress_mc.gotoAndStop("success");
            return;
        }
 
    }
   
   
    //if it doesnt, create an element for the current course and save the current track
    trace ('element '+ _global.activeCourse +' NOT found');
    var newCourse = ci_xml.createElement("Course");
    newCourse.attributes.id = _global.activeCourse;
   
    var newTrack = ci_xml.createElement("track");
    newTrack.attributes.id = _global.activeTrack;
   
    newCourse.appendChild(newTrack);
   
    ci_xml.childNodes[0].appendChild(newCourse);
 
   
   
   
    var save = _global.userData_so.flush();
    if (save){
        _root.saveProgress_mc.gotoAndStop("success");
        trace ("data saved successfully")
        trace("_global.userData_so.data.courseInfo_xml = " +  _global.userData_so.data.courseInfo_xml);
        return;
    }else{
        _root.saveProgress_mc.gotoAndStop("error");
    }
}


ok...everything appears to work fine...the shared object is created but doesnt have any elements, so the results of those two traces after i flush the SO are:





data saved successfully
_global.userData_so.data.courseInfo_xml = <Courses><Course id="ETH0047"><track id="1" /></Course></Courses>


which seems to be exactly what i want.

Now, the next time i run the swf, the trace from the getUserData function is:





xml = <Courses />

what is going on here?

View Replies !    View Related
Shared Object - Prompt Data Permissions Dialog
Hello,
I'm creating a small app to run from CD-Rom/local installation that will use multiple shared objects for data storage. To ensure proper saving without surprising the user with a permissions dialog unexpectedly, I'd like to request unlimited data storage on first time app launch - Joey Lott shows how to do this in the Actionscript Cookbook...
request=mySO.flush(1024 * 500);

My question is, Can I perform this permissions request with the user a single time with a generic app SO in global fashion, so that the permissions would be set for any SOs created during the use of the product (all written to same SO directory), or do I have to request permissions for each and every SO created? Since the latter would be unacceptable from a UE standpoint, that means stuffing all app data into a single SO which doesn't seem so great from a data config perspective...

I really appreciate your attention and help on this!
Thanks in advance,
-Maura

View Replies !    View Related
Setting ComboBox Default According To Shared Object Data
I'm using MX 2004.

I have a Flash Form that is fairly long (about 8 short pages), so I have set the form up so that it can be reviewed when the filler-outer is done and they are ready to submit it. I'm using a Shared Object to store the information they enter so they won't lose their information if they hit refresh or need to come back later.

If they go back to the page with comboboxes on it, the comboboxes have reset to the default. The answer and data in the SO haven't changed, but it looks like it to the consumer/viewer.

So, I'd like for the boxes to display the choice they picked when they were on that page. Any ideas on how I can do this? I need use the value from the database to show the particular value in the ComboBox whenever the user returns to that page.

View Replies !    View Related
Using Shared Object Data To Populate A MySQL Table
I've got a sequence of numbers in a Shared Object that I would like to write to an MySQL database table. I'm thinking that the data items in the SO should be turned into an array:


Code:
var soldItemSO:SharedObject = SharedObject.getLocal("soldItems", "/");
var soldItemNum:Array = [];
for (var i:Number = 1; i <= 10; i++) {
if (soldItemSO.data[i] != undefined) {
soldItemNum[i - 1] = soldItemSO.data[i];
}
}
And then some code to send the vars:


Code:
var LoadVarsSender:LoadVars = new LoadVars();
LoadVarsSender.onLoad = function(success:Boolean) {
if (success) {
trace("success");
}
LoadVarsSender.soldItem = soldItemNum; //Problem spot
LoadVarsSender.sendAndLoad("writeToDbase.php",LoadVarsSender,"POST");
}
And PHP to write to the database:

Code:
(writeToDbase.php)

<?php
$soldItem = $_POST['soldItem'];

$link = mysql_connect("localhost", "root","password") or die ("Unable to connect to database.");
mysql_select_db("gallery") or die ("Unable to select database.");
$sqlstatement= "INSERT INTO products (artworks) VALUES ('$artworks')";
mysql_close($link);
?>
I'm confused about how I would write individual rows into the database table since "soldItemNum" is going to have a number of data slots, and each slot should end up as a single row in the database table. Does that make sense? I'm not sure where I should loop through the array of items.

View Replies !    View Related
How To Delete Some Of The History Data In Chat Component Shared Object
Hi,
i have made a chat application using chat component,
but the chat component store the data permanentely in the server,
How to delete the history data from the chat shared object.

anyone please help me how to do this.

Thanks in advance

regards
advika

View Replies !    View Related
Shared Object Arrays - More Efficient Than Calling Several Data.variables?
Lost in the concept...

I am using several shared objects..

defined as :
so.data.a = 1;
so.data.b = 2;
so.data.c = 5;....etc. (never ending list of real values)

Is it more efficient to define the shared object as an array, as far as memory is concerned?

I know it's more easier for me to read the array, but I was wondering if there's a difference in the processing of data per say.

thanks

View Replies !    View Related
Could A MovieClip Be Stored And Shared In A Remote Shared Object?
Let's say there are two clients connected via FMS,
and have a remote shared object SO.

When one client has a movieclip mc and sets,

SO.data["movie"] = mc;

is it possible for the other client to render
the content of mc, after SO synchronization,
by simply doing:

mc = SO.data["movie"]:

???

View Replies !    View Related
Shared Objects. How To Undo Shared Object
Hi guys,

Basicaly I created a simple login function by following the shared objects tutorial (http://www.kirupa.com/developer/mx/sharedobjects.htm).

I wanted a button placed on my wlecome screen allowing the user to go back to the creating screen of the shared objects.

So basically another shared object can be made.


Any Ideas?

View Replies !    View Related
Accessing Shared Objects From Classes
I'm trying to use a SharedObject to send/receive messages in a text area (basically a chat applet). However I've run into a problem where I can't seem to pass the SO to a constructor and then use it inside the object.

This is a sample:

quote:so = SharedObject.get("users_so", null);

function chat(so) {
this.so = so;
// also tried var this.so, and var so
}

chat.prototype.cmsg(msg) {
this.so.send("chatmsg", msg);
}

c = new chat();
c.cmsg("test");


It works when I create the SharedObject in application.onAppStart and call it from the main application.* events. However the moment I try moving it anywhere else (as a properly structured application really should...) it balks.

Any ideas? I'm pretty sure this has something to do with passing by reference not-existing in ActionScript, but I've read that by passing an object in, it gets passed by reference...



























Edited: 11/28/2006 at 01:10:28 AM by seraerie

View Replies !    View Related
Accessing Shared Class From Loaded Movieclip
Hello!!!

I have written a custom class which is quite long. I created an instance of that class in the _root of my host.swf

[host.swf]
var myInstance:myClass = new myClass();

Everything works great!!!

Now, I want to create another flash movie, call it clip.swf, and load it into the host.swf; this is easily done with loadMovie.

The problem is, what if I want to create an instance of myClass inside clip.swf?

I know I can simply create an instance my calling the var function

[clip.swf]
var myClipInstance:myClass = new myClass();

However, this would mean that the Class is loaded twice, once with host.swf and another with clip.swf.

Therefore, my question is, how can I create an instance of myClass in the clip.swf without the compiler putting the Class in the clip.swf? Can I create an instance of a Class associated with a separated swf?

View Replies !    View Related
Accessing A Property Of An Object Within An Object
I have modified a simple button object, which I called the OP Button in the library, and it contains two dynamic text fields. I had to add these text fields because I encountered a problem. Having the text above the button caused the button not to activate when the user went over the dynamic text field. Tried to have the text below the button, but the blue highlight with the button made the text fuzzy. I need to have the text dynamic because I need it to hold different values.

I have created the new button. In the library of Flash it is registered as OP Button ( a name I gave the button type ). I can edit the button and see the dynamic text object, which I gave the name of NormalText. I need to know how to change the .text property of the dynamic text located in the modified simple button.

The instance of the newly created button is OP4Button and the name of the dynamic text field within this button is called NormalText. How do I change the .text property from the main stage action script?

The button was created in design mode and not through action scripts. Even though I created in design mode, I need to access it through Action Script. Any help will be greatly appreciated.

Thank you





























Edited: 06/16/2007 at 10:49:18 AM by David Cowdery

View Replies !    View Related
Accessing Data
First of all thank you for reading this. My question is a little complicated. I'm currently undergoing a project in Flash MX. I want to create a slideshow on my website for advertising products. I was wondering if anybody could put me in the right direction on how to be able to access data from my SQL so that I won't have to update images all the time and waist valuable time. Thanks in advance for your replys.

View Replies !    View Related
Accessing Data
I've read in a simple CSV file but I'm having trouble accessing the data. The variable looks like the following:

Variable _level0.data = [object #3, class 'Array'] [
0:[object #4, class 'Object'] {
one:"13",
two:"14",
three:"15",
four:"16",
five:"17",
six:"18",
seven:"19",
eight:"20",
nine:"21",
ten:"22",
eleven:"23",
twelve:"24"
},
1:[object #5, class 'Object'] {
one:"25",
two:"26",
three:"27",
four:"28",
five:"29",
six:"30",
seven:"31",
eight:"32",
nine:"33",
ten:"34",
eleven:"35",
twelve:"36"
}
]

How would I access the data and put it in a textField for example. I.E. let's say I wanted to pull back "20", would that be _level0.data[0.eight]?

Thanks in advance!

View Replies !    View Related
Accessing Data
First of all thank you for reading this. My question is a little complicated. I'm currently undergoing a project in Flash MX. I want to create a slideshow on my website for advertising products. I was wondering if anybody could put me in the right direction on how to be able to access data from my SQL so that I won't have to update images all the time and waist valuable time. Thanks in advance for your replys.

View Replies !    View Related
XML Connector - Accessing Data
How does the data in the XML Connector get accessed in ActionScript? Binding to other v2 components is straight forward, but pathing the data in the Schema (once a sample schema is loaded) in ActionScript give a undefined value...

Thanks in advanced for any help.

JJ

View Replies !    View Related
Accessing Dynamic MC Data.
Hi,

I've got 13 movie clips, each named cF1, cF2... cF13. They are in another movieclip.

How would I access the data without having to say _level0.firstlayer.cF1.data = "null";
_level0.firstlayer.cF2.data = "archive";

I'm using FlashMX.
Thanks.

View Replies !    View Related
Accessing Data From File.....
Hi Friends,
I want to know that is it possible to access data from local Machine Path while my Swf is being run on Server. Let me try to explain plz ....
Suppose i m running my swf file from server (http://www.abc.com/myfile.swf)
and a .txt file or .xml file is placed on my local drive (C:/text.txt)..now i want to know here that is it possible to access data from this text.txt file while runing my swf file On the Server ???
If it is possible... can u plz send me some link for help ???

Thanx,
IFFY

View Replies !    View Related
Accessing External Data...
Hi all! First of all, excuse my noobiness, I hope I did post in the right forum!

I am trying to create a small utility for creating artwork in an automatic manner. Basically, the user can introduce some variables, and a series of scripts will draw the aw on screen.

However, I have been asked to include a “save” and “load” option, so that the user can save the aw for future occasions… Basically, the program needs to save a few variables externally, then access to them when needed.

My problem is, I have been reading a bit on saving data/reading data from external sources, but I do not know what would be the easier way for a simple project like this… A am not looking forward to create a monster app or databases: I just want my swf to save a data file in the server with a few variables, and then access that file when needed…

Which would be the simplest way of achieving this? Thanks in advance guyz, if you could point me to a tutorial/etc, that would be great!

Regards,
River

P$ I use flash 8 professional.

View Replies !    View Related
Accessing XML Data Within Another Function.
Hey all

I have a xml file which I use to populate my stage with MC's. I have some text info and links to image files in the XML which I then use to create a bunch of MC's. Each MC has a different text bit assigned to it and a different image. Now all this works great but what I want to do now is to access that XML information again from another function to use the same image but for another function(the first time the images are thumbnails, the second time I want the images displayed larger so you can see better)

Now in the first function I load the image into a linked MC in the library using the loadMovie command:

t.icon.inner.picture.loadMovie(nodes[i].attributes.image);

Now when I try and access this information again in another function it's a problem because the scope of the t variable is within the function. So I tried to make the var a global var (_global.nodes = this.firstChild.childNodes; ) but when I execute the second function I get an error saying URL not found.

Now obviously the loadMovie usually looks for another swf to load up. however it doesn't seem to need this in the xml function. so what gives? and how do I access this xml information from another function?

Here is simplified versions of the code:

XML doc:
<?xml version="1.0" encoding="ISO-8859-1"?>

<icons>

<icon image ="images/website1.jpg" tooltip="EggFilms New Site" content="Dear Yak" />

<icon image ="images/website2.jpg" tooltip="Egg New Site" content="Dear blah." />

</icons>

The function that creates the MC's:
var xml:XML = new XML();
xml.ignoreWhite = true;

xml.onLoad = function()
{
var nodes = this.firstChild.childNodes;
numOfItems = nodes.length;
for(var i=0;i<numOfItems;i++)
{
var t = home.attachMovie("item","item"+i,i+1);
t.angle = i * ((Math.PI*2) / numOfItems);
t.toolText = nodes[i].attributes.tooltip;
t.content = nodes[i].attributes.content;
t.icon.inner.picture.loadMovie(nodes[i].attributes.image);
}
}

here is the code in the other function;

var dispPic = home.attachMovie("dispPic","DispPic",20000);
dispPic.bigger.loadMovie(nodes.attributes.image);

View Replies !    View Related
Accessing External Data
hi guys,
i have one problem while trying to accessing external data from xml. I'm creating a local banner that using xml file to read the image order (banner run locally), the image located in the http server, the information of the image included in the xml. but when I'm trying to run its display a security message that the swf trying to communicate with Internet-enable location. how could i get through this without have to go to security settings. can i do it from the actionscript?I've tried using System.security.allowDomain("*") but seems like doesn't work.thanks before.

View Replies !    View Related
Problem Accessing Data In An XML
I am making a travel companion in AS3 that gets current weather and currencyc, as well as many other functions. I have the majority of the project workig except for the currency component. My problem is that the rss feed that I want to use to get the exchange rates its quite confusing and I cant seem to find how to access sonething like <cb:value decimals="4">0.9583</cb:value> due to the wierd tag name, usually you just say something xmlData.channel.title, but with all the spaces and other characters I cant get it to access the desired data.

Here is my code so far.

Code:

var xmlURLLoader:URLLoader = new URLLoader();
var xmlURLRequest:URLRequest = new URLRequest("http://www.rba.gov.au/RSS/rss_cb_exchange_rates.xml");
xmlURLLoader.load(xmlURLRequest);

xmlURLLoader.addEventListener( Event.COMPLETE, dataLoadedCurrency);

function dataLoadedCurrency(event:Event):void {

var theXMLData:XML = new XML (xmlURLLoader.data);
titleList.push (theXMLData.channel.title) // This is where I cant work out how to call the data I want.
And here is some of the code from the xml file.


Code:
<rdf:RDF xsi:schemaLocation="http://www.w3.org/1999/02/22-rdf-syntax-ns#rdf.xsd" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rba="http://www.rba.gov.au/Statistics/exchange_rates.html" xmlns="http://purl.org/rss/1.0/" xmlns:cb="http://www.cbwiki.net/wiki/index.php/Specification_1.1" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<channel rdf:about="http://www.rba.gov.au/RSS/rss_cb_exchange_rates.xml">
<title>Reserve Bank of Australia | Exchange Rates</title>
<link>http://www.rba.gov.au/Statistics/exchange_rates.html</link>
<description>The rate shown for the US dollar is a representative mid-point determined by the Reserve Bank on the basis of quotations in the interbank foreign exchange market at 4.00 pm Australian Eastern Standard Time on the day concerned. Rates shown for most other currencies are calculated by crossing the rate for the US dollar with mid-points of buying and selling rates quoted at the same time. These rates are indications of market value only and may differ from those quoted by foreign exchange dealers.
</description>
<image rdf:resource="http://www.rba.gov.au/_images/rss_rba_logo.gif" />
<items>
<rdf:Seq>
<rdf:li rdf:resource="http://www.rba.gov.au/Statistics/exchange_rates.html#USD" />
<rdf:li rdf:resource="http://www.rba.gov.au/Statistics/exchange_rates.html#JPY" />
<rdf:li rdf:resource="http://www.rba.gov.au/Statistics/exchange_rates.html#EUR" />
<rdf:li rdf:resource="http://www.rba.gov.au/Statistics/exchange_rates.html#KRW" />
<rdf:li rdf:resource="http://www.rba.gov.au/Statistics/exchange_rates.html#NZD" />
<rdf:li rdf:resource="http://www.rba.gov.au/Statistics/exchange_rates.html#CNY" />

<rdf:li rdf:resource="http://www.rba.gov.au/Statistics/exchange_rates.html#GBP" />
<rdf:li rdf:resource="http://www.rba.gov.au/Statistics/exchange_rates.html#TWD" />
<rdf:li rdf:resource="http://www.rba.gov.au/Statistics/exchange_rates.html#SGD" />
<rdf:li rdf:resource="http://www.rba.gov.au/Statistics/exchange_rates.html#IDR" />
<rdf:li rdf:resource="http://www.rba.gov.au/Statistics/exchange_rates.html#HKD" />
<rdf:li rdf:resource="http://www.rba.gov.au/Statistics/exchange_rates.html#MYR" />
<rdf:li rdf:resource="http://www.rba.gov.au/Statistics/exchange_rates.html#CHF" />
<rdf:li rdf:resource="http://www.rba.gov.au/Statistics/exchange_rates.html#SDR" />
<rdf:li rdf:resource="http://www.rba.gov.au/Statistics/exchange_rates.html#TWI_9am" />
<rdf:li rdf:resource="http://www.rba.gov.au/Statistics/exchange_rates.html#TWI_noon" />
<rdf:li rdf:resource="http://www.rba.gov.au/Statistics/exchange_rates.html#TWI_4pm" />
</rdf:Seq>
</items>
<dc:publisher>Reserve Bank of Australia</dc:publisher>
<dcterms:license>http://www.rba.gov.au/Disclaimer/index.html</dcterms:license>

</channel>
<item rdf:about="http://www.rba.gov.au/Statistics/exchange_rates.html#USD">
<title xml:lang="en">AU: 0.9583 USD = 1 AUD 2008-07-29 RBA 4.00 pm Eastern Australian time</title>
<link>http://www.rba.gov.au/Statistics/exchange_rates.html#USD</link>
<description>
AUD/USD representative rate as at 4.00 pm Eastern Australian time on 29 Jul 2008</description>
<dc:date>2008-07-29</dc:date>
<dc:language>en</dc:language>
<dcterms:audience>general</dcterms:audience>
<cb:statistics>

<cb:country>AU</cb:country>
<cb:institutionAbbrev>RBA</cb:institutionAbbrev>
<cb:exchangeRate>
<cb:value decimals="4">0.9583</cb:value>
<cb:baseCurrency>AUD</cb:baseCurrency>
<cb:targetCurrency>USD</cb:targetCurrency>
<cb:rateType>4.00 pm foreign exchange rates</cb:rateType>
<cb:observationPeriod frequency="daily"></cb:observationPeriod>
</cb:exchangeRate>
</cb:statistics>
</item>

<item rdf:about="http://www.rba.gov.au/Statistics/exchange_rates.html#JPY">
<title xml:lang="en">AU: 102.94 JPY = 1 AUD 2008-07-29 RBA 4.00 pm Eastern Australian time</title>
<link>http://www.rba.gov.au/Statistics/exchange_rates.html#JPY</link>
<description>
AUD/JPY representative rate as at 4.00 pm Eastern Australian time on 29 Jul 2008</description>
<dc:date>2008-07-29</dc:date>
<dc:language>en</dc:language>
<dcterms:audience>general</dcterms:audience>
<cb:statistics>
<cb:country>AU</cb:country>

<cb:institutionAbbrev>RBA</cb:institutionAbbrev>
<cb:exchangeRate>
<cb:value decimals="2">102.94</cb:value>
<cb:baseCurrency>AUD</cb:baseCurrency>
<cb:targetCurrency>JPY</cb:targetCurrency>
<cb:rateType>4.00 pm foreign exchange rates</cb:rateType>
<cb:observationPeriod frequency="daily"></cb:observationPeriod>
</cb:exchangeRate>
</cb:statistics>
</item>
Any help would be greatly appreciated.

View Replies !    View Related
Accessing Data In A Class
Hey guys,

This question is hopefully simple. I have a class that loads an XML document and places it into an XML object. Does anyone know why I can't access that XML object from the XML that instantiates the class? I have a getter but it gets nothing. If I trace the XML object in the class it shows the XML but when I try to get it, it is blank....stumped.

Thanks.

View Replies !    View Related
Accessing Data In Xml Through Flash
for those of you who use xml in flash, let's say you use the following xml document:

<main>
<titlebar>
<filename>something.jpg</filename>
<text>This is text in the titlebar</text>
</titlebar>
<body>
<filename>somethingelse.jpg</filename>
</body>
</main>

and you wanted to access the value in main/titlebar/text... how would you go about it? do you have to use the nextSibling command and a for loop to count down until you get to the one you want?

View Replies !    View Related
Accessing Data From XML Arrays?
I keep getting 'undefined' if I ask for the value of a variable from an array into which XML data has been loaded. Any ideas?


Code:
// * XML ARRAYS
var unitName:Array = new Array();
var unitFacing:Array = new Array();
var unitPosition:Array = new Array();
var unitMenu1Txt:Array = new Array();
var unitMenu2Txt:Array = new Array();
var unitMenu3Txt:Array = new Array();
var unitMenu4Txt:Array = new Array();
var unitMenu5Txt:Array = new Array();
var unitSubMenu1Txt1:Array = new Array();
var unitSubMenu1Txt2:Array = new Array();
var unitSubMenu1Txt3:Array = new Array();
var unitSubMenu1Txt4:Array = new Array();
var unitSubMenu1Txt5:Array = new Array();
var unitSpeed:Array = new Array();
// * PARSE DATA
var dataXML = new XML();
dataXML.ignoreWhite = true;
dataXML.onLoad = parseXML;
function parseXML(success) {
if (success) {
var rtNode = dataXML.firstChild;
totalUnits = rtNode.childNodes.length;
var curNode = rtNode.firstChild;
for (var i = 0; i<=totalUnits; i++) {
unitName.push(curNode.childNodes[0].firstChild.nodeValue);
unitFacing.push(curNode.childNodes[1].firstChild.nodeValue);
unitPosition.push(curNode.childNodes[2].firstChild.nodeValue);
unitMenu1Txt.push(curNode.childNodes[3].firstChild.nodeValue);
unitMenu2Txt.push(curNode.childNodes[4].firstChild.nodeValue);
unitMenu3Txt.push(curNode.childNodes[5].firstChild.nodeValue);
unitMenu4Txt.push(curNode.childNodes[6].firstChild.nodeValue);
unitMenu5Txt.push(curNode.childNodes[7].firstChild.nodeValue);
unitSubMenu1Txt1.push(curNode.childNodes[8].firstChild.nodeValue);
unitSubMenu1Txt2.push(curNode.childNodes[9].firstChild.nodeValue);
unitSubMenu1Txt3.push(curNode.childNodes[10].firstChild.nodeValue);
unitSubMenu1Txt4.push(curNode.childNodes[11].firstChild.nodeValue);
unitSubMenu1Txt5.push(curNode.childNodes[12].firstChild.nodeValue);
unitSpeed.push(curNode.childNodes[14].firstChild.nodeValue);
nextNode = curNode.nextSibling;
curNode = nextNode;
}
// * PLACE UNITS, FACING, UNIT MENU, POSITIONS
for (var i = 0; i<=15; i++) {
tempUnit = "unit"+i;
_root.attachMovie("unit", tempUnit, getNextHighestDepth());
eval(tempUnit).speed = _root.unitSpeed[i];
}
}
}
dataXML.load("tactics.xml");
For example on "eval(tempUnit).speed = _root.unitSpeed[i]", I should be able to ask "trace(unit1.speed)" and get a number, but it returns undefined?

Here's my xml:


Code:
<army>

<unit0>
<unitName>Pyromancer</unitName>
<unitFacing>faceUp</unitFacing>
<unitPosition>79</unitPosition>
<unitMenu1Txt>Attack</unitMenu1Txt>
<unitMenu2Txt>Pyromancy</unitMenu2Txt>
<unitMenu3Txt>Items</unitMenu3Txt>
<unitMenu4Txt>Parry</unitMenu4Txt>
<unitMenu5Txt>Pass</unitMenu5Txt>
<unitSubMenu1Txt1>Fireball</unitSubMenu1Txt1>
<unitSubMenu1Txt2>Magic Missile</unitSubMenu1Txt2>
<unitSubMenu1Txt3>Fire Shield</unitSubMenu1Txt3>
<unitSubMenu1Txt4>Melf's Meteors</unitSubMenu1Txt4>
<unitSubMenu1Txt5>Inferno</unitSubMenu1Txt5>
<unitSpeed>0</unitSpeed>
</unit0>

<unit1>
<unitName>Pyromancer</unitName>
<unitFacing>faceUp</unitFacing>
<unitPosition>80</unitPosition>
<unitMenu1Txt>Attack</unitMenu1Txt>
<unitMenu2Txt>Pyromancy</unitMenu2Txt>
<unitMenu3Txt>Items</unitMenu3Txt>
<unitMenu4Txt>Parry</unitMenu4Txt>
<unitMenu5Txt>Pass</unitMenu5Txt>
<unitSubMenu1Txt1>Fireball</unitSubMenu1Txt1>
<unitSubMenu1Txt2>Magic Missile</unitSubMenu1Txt2>
<unitSubMenu1Txt3>Fire Shield</unitSubMenu1Txt3>
<unitSubMenu1Txt4>Melf's Meteors</unitSubMenu1Txt4>
<unitSubMenu1Txt5>Inferno</unitSubMenu1Txt5>
<unitSpeed>0</unitSpeed>
</unit1>

<unit2>
<unitName>Pyromancer</unitName>
<unitFacing>faceUp</unitFacing>
<unitPosition>81</unitPosition>
<unitMenu1Txt>Attack</unitMenu1Txt>
<unitMenu2Txt>Pyromancy</unitMenu2Txt>
<unitMenu3Txt>Items</unitMenu3Txt>
<unitMenu4Txt>Parry</unitMenu4Txt>
<unitMenu5Txt>Pass</unitMenu5Txt>
<unitSubMenu1Txt1>Fireball</unitSubMenu1Txt1>
<unitSubMenu1Txt2>Magic Missile</unitSubMenu1Txt2>
<unitSubMenu1Txt3>Fire Shield</unitSubMenu1Txt3>
<unitSubMenu1Txt4>Melf's Meteors</unitSubMenu1Txt4>
<unitSubMenu1Txt5>Inferno</unitSubMenu1Txt5>
<unitSpeed>0</unitSpeed>
</unit2>

<unit3>
<unitName>Pyromancer</unitName>
<unitFacing>faceUp</unitFacing>
<unitPosition>82</unitPosition>
<unitMenu1Txt>Attack</unitMenu1Txt>
<unitMenu2Txt>Pyromancy</unitMenu2Txt>
<unitMenu3Txt>Items</unitMenu3Txt>
<unitMenu4Txt>Parry</unitMenu4Txt>
<unitMenu5Txt>Pass</unitMenu5Txt>
<unitSubMenu1Txt1>Fireball</unitSubMenu1Txt1>
<unitSubMenu1Txt2>Magic Missile</unitSubMenu1Txt2>
<unitSubMenu1Txt3>Fire Shield</unitSubMenu1Txt3>
<unitSubMenu1Txt4>Melf's Meteors</unitSubMenu1Txt4>
<unitSubMenu1Txt5>Inferno</unitSubMenu1Txt5>
<unitSpeed>0</unitSpeed>
</unit3>

<unit4>
<unitName>Pyromancer</unitName>
<unitFacing>faceUp</unitFacing>
<unitPosition>83</unitPosition>
<unitMenu1Txt>Attack</unitMenu1Txt>
<unitMenu2Txt>Pyromancy</unitMenu2Txt>
<unitMenu3Txt>Items</unitMenu3Txt>
<unitMenu4Txt>Parry</unitMenu4Txt>
<unitMenu5Txt>Pass</unitMenu5Txt>
<unitSubMenu1Txt1>Fireball</unitSubMenu1Txt1>
<unitSubMenu1Txt2>Magic Missile</unitSubMenu1Txt2>
<unitSubMenu1Txt3>Fire Shield</unitSubMenu1Txt3>
<unitSubMenu1Txt4>Melf's Meteors</unitSubMenu1Txt4>
<unitSubMenu1Txt5>Inferno</unitSubMenu1Txt5>
<unitSpeed>0</unitSpeed>
</unit4>

<unit5>
<unitName>Pyromancer</unitName>
<unitFacing>faceUp</unitFacing>
<unitPosition>84</unitPosition>
<unitMenu1Txt>Attack</unitMenu1Txt>
<unitMenu2Txt>Pyromancy</unitMenu2Txt>
<unitMenu3Txt>Items</unitMenu3Txt>
<unitMenu4Txt>Parry</unitMenu4Txt>
<unitMenu5Txt>Pass</unitMenu5Txt>
<unitSubMenu1Txt1>Fireball</unitSubMenu1Txt1>
<unitSubMenu1Txt2>Magic Missile</unitSubMenu1Txt2>
<unitSubMenu1Txt3>Fire Shield</unitSubMenu1Txt3>
<unitSubMenu1Txt4>Melf's Meteors</unitSubMenu1Txt4>
<unitSubMenu1Txt5>Inferno</unitSubMenu1Txt5>
<unitSpeed>0</unitSpeed>
</unit5>

<unit6>
<unitName>Pyromancer</unitName>
<unitFacing>faceUp</unitFacing>
<unitPosition>85</unitPosition>
<unitMenu1Txt>Attack</unitMenu1Txt>
<unitMenu2Txt>Pyromancy</unitMenu2Txt>
<unitMenu3Txt>Items</unitMenu3Txt>
<unitMenu4Txt>Parry</unitMenu4Txt>
<unitMenu5Txt>Pass</unitMenu5Txt>
<unitSubMenu1Txt1>Fireball</unitSubMenu1Txt1>
<unitSubMenu1Txt2>Magic Missile</unitSubMenu1Txt2>
<unitSubMenu1Txt3>Fire Shield</unitSubMenu1Txt3>
<unitSubMenu1Txt4>Melf's Meteors</unitSubMenu1Txt4>
<unitSubMenu1Txt5>Inferno</unitSubMenu1Txt5>
<unitSpeed>0</unitSpeed>
</unit6>

<unit7>
<unitName>Pyromancer</unitName>
<unitFacing>faceUp</unitFacing>
<unitPosition>86</unitPosition>
<unitMenu1Txt>Attack</unitMenu1Txt>
<unitMenu2Txt>Pyromancy</unitMenu2Txt>
<unitMenu3Txt>Items</unitMenu3Txt>
<unitMenu4Txt>Parry</unitMenu4Txt>
<unitMenu5Txt>Pass</unitMenu5Txt>
<unitSubMenu1Txt1>Fireball</unitSubMenu1Txt1>
<unitSubMenu1Txt2>Magic Missile</unitSubMenu1Txt2>
<unitSubMenu1Txt3>Fire Shield</unitSubMenu1Txt3>
<unitSubMenu1Txt4>Melf's Meteors</unitSubMenu1Txt4>
<unitSubMenu1Txt5>Inferno</unitSubMenu1Txt5>
<unitSpeed>0</unitSpeed>
</unit7>

<unit8>
<unitName>Pyromancer</unitName>
<unitFacing>faceDown</unitFacing>
<unitPosition>16</unitPosition>
<unitMenu1Txt>Attack</unitMenu1Txt>
<unitMenu2Txt>Pyromancy</unitMenu2Txt>
<unitMenu3Txt>Items</unitMenu3Txt>
<unitMenu4Txt>Parry</unitMenu4Txt>
<unitMenu5Txt>Pass</unitMenu5Txt>
<unitSubMenu1Txt1>Fireball</unitSubMenu1Txt1>
<unitSubMenu1Txt2>Magic Missile</unitSubMenu1Txt2>
<unitSubMenu1Txt3>Fire Shield</unitSubMenu1Txt3>
<unitSubMenu1Txt4>Melf's Meteors</unitSubMenu1Txt4>
<unitSubMenu1Txt5>Inferno</unitSubMenu1Txt5>
<unitSpeed>0</unitSpeed>
</unit8>

<unit9>
<unitName>Pyromancer</unitName>
<unitFacing>faceDown</unitFacing>
<unitPosition>9</unitPosition>
<unitMenu1Txt>Attack</unitMenu1Txt>
<unitMenu2Txt>Pyromancy</unitMenu2Txt>
<unitMenu3Txt>Items</unitMenu3Txt>
<unitMenu4Txt>Parry</unitMenu4Txt>
<unitMenu5Txt>Pass</unitMenu5Txt>
<unitSubMenu1Txt1>Fireball</unitSubMenu1Txt1>
<unitSubMenu1Txt2>Magic Missile</unitSubMenu1Txt2>
<unitSubMenu1Txt3>Fire Shield</unitSubMenu1Txt3>
<unitSubMenu1Txt4>Melf's Meteors</unitSubMenu1Txt4>
<unitSubMenu1Txt5>Inferno</unitSubMenu1Txt5>
<unitSpeed>0</unitSpeed>
</unit9>

<unit10>
<unitName>Pyromancer</unitName>
<unitFacing>faceDown</unitFacing>
<unitPosition>10</unitPosition>
<unitMenu1Txt>Attack</unitMenu1Txt>
<unitMenu2Txt>Pyromancy</unitMenu2Txt>
<unitMenu3Txt>Items</unitMenu3Txt>
<unitMenu4Txt>Parry</unitMenu4Txt>
<unitMenu5Txt>Pass</unitMenu5Txt>
<unitSubMenu1Txt1>Fireball</unitSubMenu1Txt1>
<unitSubMenu1Txt2>Magic Missile</unitSubMenu1Txt2>
<unitSubMenu1Txt3>Fire Shield</unitSubMenu1Txt3>
<unitSubMenu1Txt4>Melf's Meteors</unitSubMenu1Txt4>
<unitSubMenu1Txt5>Inferno</unitSubMenu1Txt5>
<unitSpeed>0</unitSpeed>
</unit10>

<unit11>
<unitName>Pyromancer</unitName>
<unitFacing>faceDown</unitFacing>
<unitPosition>11</unitPosition>
<unitMenu1Txt>Attack</unitMenu1Txt>
<unitMenu2Txt>Pyromancy</unitMenu2Txt>
<unitMenu3Txt>Items</unitMenu3Txt>
<unitMenu4Txt>Parry</unitMenu4Txt>
<unitMenu5Txt>Pass</unitMenu5Txt>
<unitSubMenu1Txt1>Fireball</unitSubMenu1Txt1>
<unitSubMenu1Txt2>Magic Missile</unitSubMenu1Txt2>
<unitSubMenu1Txt3>Fire Shield</unitSubMenu1Txt3>
<unitSubMenu1Txt4>Melf's Meteors</unitSubMenu1Txt4>
<unitSubMenu1Txt5>Inferno</unitSubMenu1Txt5>
<unitSpeed>0</unitSpeed>
</unit11>

<unit12>
<unitName>Pyromancer</unitName>
<unitFacing>faceDown</unitFacing>
<unitPosition>12</unitPosition>
<unitMenu1Txt>Attack</unitMenu1Txt>
<unitMenu2Txt>Pyromancy</unitMenu2Txt>
<unitMenu3Txt>Items</unitMenu3Txt>
<unitMenu4Txt>Parry</unitMenu4Txt>
<unitMenu5Txt>Pass</unitMenu5Txt>
<unitSubMenu1Txt1>Fireball</unitSubMenu1Txt1>
<unitSubMenu1Txt2>Magic Missile</unitSubMenu1Txt2>
<unitSubMenu1Txt3>Fire Shield</unitSubMenu1Txt3>
<unitSubMenu1Txt4>Melf's Meteors</unitSubMenu1Txt4>
<unitSubMenu1Txt5>Inferno</unitSubMenu1Txt5>
<unitSpeed>0</unitSpeed>
</unit12>

<unit13>
<unitName>Pyromancer</unitName>
<unitFacing>faceDown</unitFacing>
<unitPosition>13</unitPosition>
<unitMenu1Txt>Attack</unitMenu1Txt>
<unitMenu2Txt>Pyromancy</unitMenu2Txt>
<unitMenu3Txt>Items</unitMenu3Txt>
<unitMenu4Txt>Parry</unitMenu4Txt>
<unitMenu5Txt>Pass</unitMenu5Txt>
<unitSubMenu1Txt1>Fireball</unitSubMenu1Txt1>
<unitSubMenu1Txt2>Magic Missile</unitSubMenu1Txt2>
<unitSubMenu1Txt3>Fire Shield</unitSubMenu1Txt3>
<unitSubMenu1Txt4>Melf's Meteors</unitSubMenu1Txt4>
<unitSubMenu1Txt5>Inferno</unitSubMenu1Txt5>
<unitSpeed>0</unitSpeed>
</unit13>

<unit14>
<unitName>Pyromancer</unitName>
<unitFacing>faceDown</unitFacing>
<unitPosition>14</unitPosition>
<unitMenu1Txt>Attack</unitMenu1Txt>
<unitMenu2Txt>Pyromancy</unitMenu2Txt>
<unitMenu3Txt>Items</unitMenu3Txt>
<unitMenu4Txt>Parry</unitMenu4Txt>
<unitMenu5Txt>Pass</unitMenu5Txt>
<unitSubMenu1Txt1>Fireball</unitSubMenu1Txt1>
<unitSubMenu1Txt2>Magic Missile</unitSubMenu1Txt2>
<unitSubMenu1Txt3>Fire Shield</unitSubMenu1Txt3>
<unitSubMenu1Txt4>Melf's Meteors</unitSubMenu1Txt4>
<unitSubMenu1Txt5>Inferno</unitSubMenu1Txt5>
<unitSpeed>0</unitSpeed>
</unit14>

<unit15>
<unitName>Pyromancer</unitName>
<unitFacing>faceDown</unitFacing>
<unitPosition>15</unitPosition>
<unitMenu1Txt>Attack</unitMenu1Txt>
<unitMenu2Txt>Pyromancy</unitMenu2Txt>
<unitMenu3Txt>Items</unitMenu3Txt>
<unitMenu4Txt>Parry</unitMenu4Txt>
<unitMenu5Txt>Pass</unitMenu5Txt>
<unitSubMenu1Txt1>Fireball</unitSubMenu1Txt1>
<unitSubMenu1Txt2>Magic Missile</unitSubMenu1Txt2>
<unitSubMenu1Txt3>Fire Shield</unitSubMenu1Txt3>
<unitSubMenu1Txt4>Melf's Meteors</unitSubMenu1Txt4>
<unitSubMenu1Txt5>Inferno</unitSubMenu1Txt5>
<unitSpeed>0</unitSpeed>
</unit15>

</army>

View Replies !    View Related
Accessing Array Data
Hi all,

How do I access an array inside an .swf that is loaded using loadMovie?

this.createEmptyMovieClip("controlpanel", 999);
loadMovie("lessons/regulatoryrequirements.swf", controlpanel);

forward_btn.onRelease = function() {
attachMovie(screen_array[0], "currentscreen", 0, {_x:500, _y:360});
};

screen_array is the array I'm trying to access in regulatoryrequirements.swf.

thanks!

View Replies !    View Related
Accessing Data From Another Domain
errrr...using Flash 7, anyone got a way to do this without using the crossdomain.xml file?

this really stinks...

View Replies !    View Related
Accessing Data In Objects
I posted on the XML boards but later realized that this particular question is more of a Actionscript question.

I just used Branden Hall's ©Deserializer to convert WDDX into a flash object. The object mimics the structure of the wddx (xml nodes). How can I properly access the data in an Object (with nodes of data)?

View Replies !    View Related
Accessing Variable Data Between Movies
I'm having some troubles with variables. I'm assuming the solution is in utilizing global variables, which I am having difficulty with.

Problem:
_level0 pulls in database data via an ASP file. I want to display a value from the database in _level1. I don't want to load variables from database again in _level1 because of performance issues. What's the best way to get the data from _level0 to _level1.

Your assistance will be greatly appreciated.

View Replies !    View Related
Accessing Data From Dynamic Gen Arrays...
Okay guys, here's what I'm doing. In part one I'm parsing the XML data and the pushing all of the text data into arrays, dynamically.

Using a "for" loop I'm using the attachMovie to generate and place buttons on the stage using the array.length property. So, basically what I want to do is to be able to click on one of the buttons(movieclip) and have it display in a text field. For some reason it's not displaying the text properly. If I write the following...



genreName_txt.text = genre_array[i];

it will not display the text in the text field and it will return "undefinded" when running a trace. But if I write

genreName_txt.text = genre_array[3];

for example, it displays the proper text in the text field.

Why can't I use the "genre_array[i]" to access text within the genre_array?



genreXML = new XML();
genre_array = new Array();
ginfo_array = new Array();
genreXML.ignoreWhite = true;
genreXML.load("Genrelist.xml");
genreXML.onLoad = function(success) {
if (success) {
var rootNode = this.firstChild;
var children = rootNode.childNodes;
for (i=0; children[i]; i++) {
var Genre = children[i].attributes.genre;
var List = children[i].firstChild.nodeValue;
//trace ("Genre : "+Genre);
genre_array.push(Genre);
ginfo_array.push(List);
}
buildIt();
}
};


//-------Build Genre Buttons----------
function Buildit() {
for (i=1; i<=genre_array.length; i++) {
attachMovie("daButton_mc", "genre_mc"+i, i);
this["genre_mc"+i]._x = 95+(i-1)*10;
this["genre_mc"+i]._y = 498;
this["genre_mc"+i]._xscale = 60;
this["genre_mc"+i]._yscale = 90;
this["genre_mc"+i].id = i;
this["genre_mc"+i].onRollover = function() {
rollOver(this);
genreName_txt.text = genre_array[i];
};
this["genre_mc"+i].onRollOut = function() {
rollOut(this);
genreName_txt.text = "";
};
}
}

View Replies !    View Related
Accessing XML-Data Loaded In A Class
Hi Guys,

I got a little problem with my classes. The structure is very simple: I've got a xml-file I want to load, wich is working fine. When loaded I'd like to access the xml-data from within my fla or within another class. That's the point where I'm stuck right now. I can access the xml-data from within the class, but not from another class. I hope someone can help me.

Here's my xml-class [xmldata.as]:

PHP Code:



package
{
import flash.net.URLLoader
import flash.net.URLRequest
import flash.xml.XMLDocument;
import flash.errors.*
import flash.events.*
    public class xmldata extends EventDispatcher {
        private var xmlloader : URLLoader;
        public static var mainXML : XML;
//        public static var getit:XML;
        
        public function xmldata(datafile) {
        xmlloader = new URLLoader();
        xmlloader.addEventListener(Event.COMPLETE, onComplete);
        xmlloader.load(new URLRequest(datafile));
        }
        private function onComplete(e:Event) {
            try {
                mainXML = new XML(xmlloader.data)
                trace(mainXML.hotspots.hotspot.length());
                dispatchEvent(new Event("xmlloaded"));
            } 
            catch(er:Error) {
                trace("Error: " + er.message)
                return;
            }
        }
    }





Just for testing I put the following code into a .fla which is ment to be in a class further on:

PHP Code:



import xmldata;

var test:xmldata = new xmldata("vars.xml");
test.addEventListener("xmlloaded",soldier)
function soldier(e:Event){
    trace(xmldata);





Any ideas or suggestions? I'd be glad to have a notice!
Greets
hellslawyer

[EDIT]: To get it clear I uploaded a simple example of what I want to make.

View Replies !    View Related
Accessing URLVariable Data Once Loaded
Here is a sample of the data being loaded in a 'guestbook' program. I believe the source of the data is irrelevant.

gbSize=50&gbCount=13&startN=NoneYa&startE=noneya@damnbusiness.com&startM= I think that covers it! :)&startD=2/19/2008&date=2/19/2008&gbName1=NoneYa&gbEmail1=noneya@damnbusiness.com&gbMess1= I think that covers it! :)&gbDate1=2/19/2008&gbName2=Diddle Diddle&gbEmail2=hey@nurseryrhymes.com&gbMess2= The cat and the fiddle&gbDate2=2/19/2008&gbName3=Mary&gbEmail3=littlelamb@nurseryrhymes.com&gbMess3= Its fleece was white as snow.&gbDate3=2/19/2008&gbName4=Bluebeard&gbEmail4=captain@pirate.org&gbMess4= Yo Ho Ho, A pirates life for me!&gbDate4=2/19/2008

this continues through the existing 13 records currently in the database. As you can see, after the initial data pairs, the names develop a pattern (example: gbName1, gbName2, gbName3, etc.). This is all stored in a URLVariables cast variable called currRecords.

Normally, to get a specific piece of data, I would say:

myText = currRecords.gbName3 which would give me the value "Diddle Diddle". So, I thought, "Why not replace gbName4 with a variable appended with an integer to get each record in the data set. Like this:
var myTest:String = "gbName" + iCurrRecord.toString(); <= where iCurrRecord is an integer that tracks the currently displayed record.
Then, use myTest in place of the "gbName4", as such:
myText = currRecords.myTest;

However, when I do this, I get a runtime error: "TypeError: Error #2007: Parameter text must be non-null."

Anybody have any ideas how to resolve this problem? Thanks in advance.

View Replies !    View Related
HELP-Accessing XML Data To Dynamic TextField
This should be pretty simple, but I'm having trouble. I have an instance of dynamic text field "test_txt" on the stage. In the XML data, the first child of the first child has the name of an image (or Array # [0]). There are two problems. I can't figure out how to get xmlList[0] into the test_txt field. Also, the trace statement works, but it won't stop.

A. Stop the output.
B. The output data is correct, i just need to get it into the text field.

Thanks.









Attach Code

var xml:XML;
var xmlList:XMLList;
var xmlLoader:URLLoader = new URLLoader;
xmlLoader.load(new URLRequest("data/imagesT.xml"));


xmlLoader.addEventListener(Event.COMPLETE, xmlLoaded);
//test_txt.addEventListener(Event.COMPLETE, loadText);



function xmlLoaded(event:Event):void
{
xml = XML(event.target.data);
xmlList = xml.children().children();
trace(xmlList[0]);
}


/*function loadText(event:Event):void

{
test_txt.text = xmlList[0];
}*/

View Replies !    View Related
Accessing Shape Data With Actionscript
Hello.

I'm wondering, is it possible to access shape data with actionscript. I want to draw simple lines with "line tool" somewhere in my movieclip and then to access information about my lines with actionscript to get startX, startY and endX endY of every line. Is it possible?

thank you.

View Replies !    View Related
Copyright © 2005-08 www.BigResource.com, All rights reserved