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








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)?




Ultrashock Forums > Flash > ActionScript
Posted on: 2002-08-20


View Complete Forum Thread with Replies

Sponsored Links:

Accessing Objects
Hi!

This is my first post here, so be nice to me )
How can i get access to objects which objectnames are saved in a string?

such as: (doesn't work)

nameOfTextfields = new Array("foobar1", "foobar2");
nameOfTextfields[0].text = "foobar";

i've tried the tellObjects() function, but isn't there an easyer way?


thx!

View Replies !    View Related
Accessing Objects Without Name
I put few Objects in the stage. Now I need to label them so I used the following code.


ActionScript Code:
var objectList:Array=new Array("apple","ball","cat","dog");
for(var i:uint=0;i<objectList.length;i++)
{
    var obj:Object = getChildByName(objectList[i]);
    var labelText:TextField=new TextFeild();
    labelText.text="This is "+objectList[i];
    labelText.x=obj.x;
    labelText.y=obj.y;
    addChild(labelText);
}

Yeppy! everything works.

Now there is a button called "clear". When it is pressed all the labels needs to be cleared.
Naturally, if I do labelText.text="", only the last label is cleared.
Any idea to clear all of them?

View Replies !    View Related
Accessing Objects In An Array
I have a card matching game I'm working on. My idea is that when two cards are turned over, they are placed in an Array. The array then checks to see if they are a match. The issue is that the card instance names will not match since both cards need to have different instance names onstage. I've tried just having the cards dump a number into the array, so then the numbers will match; but if it's not a match, I can't make the specific cards that were selected turn back over.
I could use two arrays, one for numbers and one that will hold the card MCs, but I was hoping there was a more elegant, streamlined solution.

To sum up, i guess my question is this...
When i've put an object like a movie clip instance into an array, can I use the array to access the objects' variables, functions, or anything so I can use THAT information to compare the cards other than their instance names?

View Replies !    View Related
Accessing Child Objects
Hi, is it possible to access the methods of a child object through the parent object?

View Replies !    View Related
Accessing Objects In Other Functions.
I'm working on a flash video player and I'm trying to figure out how to access something inside the constructor that I know is set but it keeps telling me its not.

Here is the code

ActionScript Code:
package player {
    import flash.display.Sprite;
    import flash.media.Video;
    import flash.net.NetStream;
    import flash.net.NetConnection;
    import flash.utils.Timer;
   

    public class InfernoPlayer extends Sprite {
       
        // Declare variables
        var vWidth:Number = 720;
        var vHeight:Number = 480;
        var duration:Number;
        var ratio:Number;
       
        // Set up the stream and video object
        public function InfernoPlayer() {
           
            // Create the video object
            var video:Video = new Video(vWidth, vHeight);
            addChild(video);
           
            // Create a new NetConnection and connect / open a NetStream channel
            var netCon:NetConnection = new NetConnection();
            netCon.connect(null);
            var netStream:NetStream = new NetStream(netCon);
           
            // Set up the meta data handler and resize video if it is to small/large
            var meta:Object = new Object();
            meta.onMetaData = metaData;
            netStream.client = meta;
                       
            // Attach video to the NetStream and start then pause playback
            video.attachNetStream(netStream);
            netStream.play("videoURL");   
           
           
        }
       
        private function metaData(meta:Object):void {
           
            var duration = meta.duration;
            var ratio = meta.height / 480;
            video.width = meta.width / ratio;
            video.height = meta.height / ratio;
           
        }
       
    }
   
}

now in the metadata function its giving me the error, "Access of undefined property video"

Now, am I just completely not understanding how classes work or is this a common problem?

View Replies !    View Related
Accessing Objects Inside Another Swf
I am trying to keep from building one large swf in order to help a broswer window to launch more readily (28k modem audience). Can I have a button in one swf run a movie clip inside another swf in this same browser window?

Thanks

View Replies !    View Related
AS3 Accessing External SWF Objects
Hello

I do understand that in Flash 8 (AS2) you can create and empty clip, then load SWF file and access objects inside it through this movieclip. For example if I have an instance of somethig called "inst" and I compile SWF, then after I load it in another project I can do MovieClipName.inst._x = 50;

Now in Flash 9 (AS3) I cant do that, since I have to use the loader, and if I try to do LoaderName.inst._x = 50 - that would not work. So how should I have to do this now?

In few words I have a project called MainProject.fla there I load up a movie with this:

var _ldr:Loader = new Loader;
var _req:URLRequest = new URLRequest("test.swf");
_ldr.load(_req);

Now in test.swf I have a bitmap with instance called "MyBitmap" . How can I change position of that bitmap in that SWF file after I load it?

View Replies !    View Related
Help With Accessing Dynamic Objects
Hi all


Ok its my third day on the AS3 learning curve, go easy on me:)




Hit a problem and hope someone can help..

I have created a several child objects (MovieClips) they inturn have their
own birthed objects inside them

MC_Holder < MC_Holder_Preload < MC_Holder_Preload_TextField

MC_Holder < MC_Holder_Sprite < MC_Holder_Image

So MC_Holder has two child MC's etc etc


This all works fine!

The problem im having is that when "MC_Holder_Image" runs, the
ProgressEvent.PROGRESS listener needs to update the
"MC_Holder_Preload_TextField", just wondering how i get the information into
this dynamic object...

There are 32 of these at present they all have been given names from a loop
("Name "+i)...


So the objects i will need to update will be "MC_Holder_Preload_TextField_0"
through "MC_Holder_Preload_TextField_31"

private function progressHandler (event:ProgressEvent):void
{
event.target--->NEED HELP HERE<--- = event.bytesLoaded;
}



Everyrthing works fine, the images are loading from an XML schema etc etc...


Sorry if that sounds crazy, late here 04:44 infact...lol, coffee for the
correct answer!



Thanks

Rick




Code For The Class :

package
{
import flash.display.MovieClip;
import flash.display.Sprite;
import flash.events.*;
import flash.net.*;
import flash.display.*;
import flash.net.URLRequest;
import flash.text.TextField;
import flash.text.TextFormat;
import flash.text.Font;
import flash.text.*;

import xmllist;

public class imagemc extends MovieClip
{

public var ldr:Loader = new Loader();
public var holder_Preloader:MovieClip = new MovieClip();
public function imagemc (xmlArray,URLimages):void
{
trace ("CLASS CONSTRUCTOR : IMAGEMC");
for (var i:int=0; i<xmlArray.length; i++)
{
buildSlideContent (xmlArray,URLimages,i);
}
}
public function buildSlideContent (xmlArray,URLimages,i):void
{
// CREATE MAIN CLIP
var holder:MovieClip = new MovieClip();
holder.graphics.lineStyle (1, 0xFF0000, 1);
holder.graphics.moveTo (0, 0);
holder.graphics.lineTo (760, 0);
holder.graphics.moveTo (760, 0);
holder.graphics.lineTo (760, 390);
holder.graphics.moveTo (760, 390);
holder.graphics.lineTo (0, 390);
holder.graphics.moveTo (0, 390);
holder.graphics.lineTo (0, 0);
holder.name = "MC_Holder_"+i;
holder.x = 0;
addChild (holder);
// IMPORT TEXT
var Font_Levenim:Font=new Font1();
var Font_Levenim_Format:TextFormat = new TextFormat();
Font_Levenim_Format.font=Font_Levenim.fontName;
// CREATE TEXT FIELD //
var holder_Preloader_Text:TextField = new TextField();
holder_Preloader_Text.defaultTextFormat = Font_Levenim_Format;
holder_Preloader_Text.embedFonts = true;
holder_Preloader_Text.name = "MC_PRELOADER_TEXT_1_"+i;
holder_Preloader_Text.x = 0;
holder_Preloader_Text.y = 10*i;
holder_Preloader_Text.width = 350;
holder_Preloader_Text.height = 20;
holder_Preloader_Text.border = false;
holder_Preloader_Text.background = false;
holder_Preloader_Text.text = "HELLO";
holder_Preloader_Text.textColor = 0xFF0000;
holder_Preloader_Text.multiline = false;
holder_Preloader_Text.wordWrap = false;
holder_Preloader_Text.selectable = false;
// CREATE PRELOADER CLIP //
var holder_Preloader:MovieClip = new MovieClip();
holder_Preloader.graphics.lineStyle (1, 0xFF6600, 1);
holder_Preloader.graphics.moveTo (0, 0);
holder_Preloader.graphics.lineTo (760, 0);
holder_Preloader.graphics.moveTo (760, 0);
holder_Preloader.graphics.lineTo (760, 390);
holder_Preloader.graphics.moveTo (760, 390);
holder_Preloader.graphics.lineTo (0, 390);
holder_Preloader.graphics.moveTo (0, 390);
holder_Preloader.graphics.lineTo (0, 0);
holder_Preloader.name = "MC_PRELOADER_"+i;
holder_Preloader.x = 0;
holder.addChild (holder_Preloader);
holder_Preloader.addChild (holder_Preloader_Text);

// CREATE IMAGE HOLDER SPRITE
var holder_Sprite:Sprite = new Sprite();
holder_Sprite.graphics.lineStyle (1, 0xFF6600, 1);
holder_Sprite.graphics.moveTo (0, 0);
holder_Sprite.graphics.lineTo (760, 0);
holder_Sprite.graphics.moveTo (760, 0);
holder_Sprite.graphics.lineTo (760, 390);
holder_Sprite.graphics.moveTo (760, 390);
holder_Sprite.graphics.lineTo (0, 390);
holder_Sprite.graphics.moveTo (0, 390);
holder_Sprite.graphics.lineTo (0, 0);
holder_Sprite.name = "SP_Holder_"+i;
holder_Sprite.x = 80;
holder.addChild (holder_Sprite);
// CREATE IMAGE
var ldr:Loader = new Loader();
ldr.name = "IMG_"+i;
var url:String = URLimages+xmlArray;
var urlReq:URLRequest = new URLRequest(url);
ldr.load (urlReq);
ldr.x = 0;
configureListeners (ldr.contentLoaderInfo);
holder_Sprite.addChild (ldr);
}
private function configureListeners (dispatcher:IEventDispatcher):void
{
dispatcher.addEventListener (Event.COMPLETE, completeHandler);
dispatcher.addEventListener (HTTPStatusEvent.HTTP_STATUS,
httpStatusHandler);
dispatcher.addEventListener (Event.INIT, initHandler);
dispatcher.addEventListener (IOErrorEvent.IO_ERROR, ioErrorHandler);
dispatcher.addEventListener (Event.OPEN, openHandler);
dispatcher.addEventListener (Event.UNLOAD, unLoadHandler);
dispatcher.addEventListener (ProgressEvent.PROGRESS, progressHandler);
}
private function completeHandler (event:Event):void
{
trace ("HANDLER : COMPLETED > " + event +
event.currentTarget.loader.name);

}
private function openHandler (event:Event):void
{
trace ("HANDLER : OPEN > " + event + ldr);
}
private function progressHandler (event:ProgressEvent):void
{
---------------------------------------------------------------------------------------------------------->
HELP event.target.="HOOOOOOOOOOOOO"; <-----
trace ("HANDLER : PROGRESS LOADED > " + event.bytesLoaded + " total: " +
event.bytesTotal);
}
private function securityErrorHandler (event:SecurityErrorEvent):void
{
trace ("HANDLER : SECURITY > " + event);
}
private function httpStatusHandler (event:HTTPStatusEvent):void
{
trace ("HANDLER : HTTP STATUS > " + event);
}
private function ioErrorHandler (event:IOErrorEvent):void
{
trace ("HANDLER : I O ERROR > " + event);
}
private function unLoadHandler (event:Event):void
{
trace ("HANDLER : UNLOADED > " + event);
}
private function initHandler (event:Event):void
{
trace ("HANDLER : INIT > " + event);
}
}
}

View Replies !    View Related
Accessing The Tab Order Of Objects
Hello,
I am having difficulty determining the identity of the next object in the tabbing order. I set the tabIndex of a group of text fields as they are attached and upon running the app the tab key works as expected. However, another requirement is that upon a condition (say length of field reached while typing) I want to actionscript to move the focus to the next text field in the tabbing order. The problem is I don't know what field that is.

getFocus() will return me a tabIndex of the field I am on. But setFocus() wants an object name. focusManager has a nextTabIndex property but there again, just a number. I could build my own array of objects as I set the tabIndex, but that seems a little clunky and operates independently of Flashes handling of it.

I understand this functionality was meant for use with the tab key, but it sure would be nice to query against wherever Flash has stored its reference to objects in tab order. Is that possible? Or is there another way to approach moving the focus the next field without requiring a tab keystroke?

Thanks for any help you may provide.

View Replies !    View Related
Accessing Array Within XML Objects
Here's my code:


Code:

function loadProjects(loaded){
if(loaded){
projects = this.firstChild.childNodes;
projectName = new Array();
projectImage = new Array();
projectDesc = new Array();
projectShtDesc = new Array();
projectLink = new Array();
projectNext = new Array();
for(i = 0;i < projects.length;i++){
projectName.push(projects[i].attributes.name);
}
trace(projectName);
trace(projectName.length);
}
else {
trace("PROJECTS NOT LOADED");
}
}

projectData = new XML();
projectData.ignoreWhite = true;
projectData.onLoad = loadProjects;
projectData.load("projectData.xml");


var numProjects = projectName.length;
trace(projectName);
trace(numProjects);
the traces within the function return correct results, however when trace values of the arrays within the function and created by the xml are attempted results are returned 'undefined'.

Why can I not access arrays made in this way from outside of the function?

thanks!

View Replies !    View Related
Accessing Objects Within MovieClips
I'd like to use instance names to access movie clips that are inside other movie clips, which may be inside other movie clips, etc. Everything works fine until things start moving, and then instance names become weird...

Sometimes, I can access the instance name, but tracing the position reveals that it isn't moving (even though I can see it moving on the screen!)

Sometimes, I can't even access the instance name, and even getChildByName returns null.

It's been driving me crazy for days now... Could anyone shed some light on this issue, what's going on???

Thanks a lot!
Emil

View Replies !    View Related
Accessing Objects In DisplayList
Hi,
I have problem with accessing objects in AS3.0.
Suppose I write this code on MainTimeLine:


Code:

var sprite1:Sprite = new Sprite();
var sprite1Child:Sprite = new Sprite();
sprite1.addChild(sprite1Child);
addChild(sprite1);


//custom class
var myMC:myMovieClip = new myMovieClip();
Now from myMC I want to reference sprite1Child object.
How?

To access sprite1 I use this code inside myMC:

Code:

this.parent.getChildAt(0)
That works, but I can’t reference sprite1Child which is inside sprite1.
Thanks,

View Replies !    View Related
Accessing Objects On Stage
Hello all,

Could someone explain me the concept of objects at the stage? How I would access them.

For example: I've made 3 classes, in one of them I made an container that contains a Circle. In another class I want to access them. So I know the structure of the stage is now as follow:

stage
_ container
____ circle

First I thought about giving the container a name so I could access it with getChildByName(). Only when I try stage.getChildByName() I get the error that I cannot access a property or method of a null object reference.

Thanks in advance

View Replies !    View Related
Accessing Objects In Other Functions
I'm having difficulty controlling objects created in one function, by another function. I'm adding the children to the stage, stage.addChild("lrg" +i), and trying to reference the children by stage["lrg"+id]. I think I'm just doing something wrong with the syntax. Any ideas?

Here's the error I'm getting:

Code:
ReferenceError: Error #1069: Property lrg8 not found on flash.display.Stage and there is no default value.
at playertest2_fla::MainTimeline/showPicture()
And here's the relevant code:

Code:
function loadXML(event:Event):void {
currentPlaying = 0;
xml = XML(event.target.data);
xmlList = xml.children();
for (var i:int=0; i < xmlList.length(); i++) {



imageLoader = new Loader();

imageLoader.load(new URLRequest(searchAndReplace(xmlList[i].attribute("tn"), "/tn/", "/tn2/")));

imageLoaderBig = new Loader();

imageLoaderBig.load(new URLRequest(xmlList[i].attribute("tn")));

imageLoaderBig.y = 268;
imageLoaderBig.x = i * 50 - 18;
imageLoaderBig.alpha = 0;
imageLoaderBig.name = "lrg" + i;
stage.addChild(imageLoaderBig);

this["myHolder" + i] = new MovieClip();

stage.addChild(this["myHolder" + i]);


this["myHolder" + i].y = 335;
this["myHolder" + i].x = i * 50 + 10;



this["myHolder" + i].addChild(imageLoader);

imageLoader.name = "id" + i;

this["myHolder" + i].addEventListener(MouseEvent.MOUSE_OVER, showPicture);
this["myHolder" + i].addEventListener(MouseEvent.CLICK, showVideo);


}
}


function showPicture(event:MouseEvent):void {
var hovered = searchAndReplace(event.target.name, "id", "");
trace(hovered);
trace(stage["lrg"+id]);
}

View Replies !    View Related
Accessing Class Objects Via The Name
Hello

I have a class name Contents I am creating 5 objects of this class. Is there a way to keep track of the instance names assigned to the objects. What I am doing is get all the objects of Contents class and make button out of these and when user clicks a button the I want to reterieve descrioption from Contents class but I dont have any mean of storing the instance name. I think I am not making any sense so here is some code


Code:
public class TestContent extends EventDispatcher
{
//Class properties

private var _desc:String;

private static var _children:Array = new Array();

// Class Constructor
public function TestContent(name:String, desc:String)
{
// I want to store the name assigned to this object so I can use this later
this.instanceName = name;
_desc = desc;

TestContent._children.push(this);

}
public function get name():String
{
return this.instanceName;
}

public function get desc():String
{
return _desc;
}
public static function getChildren():Array
{
return _children;
}
So in another class I am using the number of objects of this class to create buttons

Code:

//Some other class

parentSprite:Sprite = new Sprite;
var mArray:Array = new Array;
mArray = TestContents.getChildren();

for (i = 0; i<mArray.length; i++)
{
var mc:MovieClip = new MovieClip(mArray[i])
parentSprite.addChild(mc);
}
parentSprite.addEventListener(MouseEvent.CLICK, onClikc);

public function onClick(e:MouseEvent):void
{
// here I wanna use the instance name of the TestContents object to call the desc property
trace(e.target.desc);
}
I hope I am making sense here

Thanks in advance

View Replies !    View Related
Accessing Objects In Other Functions
I'm working on a flash video player and I'm trying to figure out how to access something inside the constructor that I know is set but it keeps telling me its not.

Here is the code

Code:

package player {
    import flash.display.Sprite;
    import flash.media.Video;
    import flash.net.NetStream;
    import flash.net.NetConnection;
    import flash.utils.Timer;
   

    public class InfernoPlayer extends Sprite {
       
        // Declare variables
        var vWidth:Number = 720;
        var vHeight:Number = 480;
        var duration:Number;
        var ratio:Number;
       
        // Set up the stream and video object
        public function InfernoPlayer() {
           
            // Create the video object
            var video:Video = new Video(vWidth, vHeight);
            addChild(video);
           
            // Create a new NetConnection and connect / open a NetStream channel
            var netCon:NetConnection = new NetConnection();
            netCon.connect(null);
            var netStream:NetStream = new NetStream(netCon);
           
            // Set up the meta data handler and resize video if it is to small/large
            var meta:Object = new Object();
            meta.onMetaData = metaData;
            netStream.client = meta;
                       
            // Attach video to the NetStream and start then pause playback
            video.attachNetStream(netStream);
            netStream.play("videoURL");   
           
           
        }
       
        private function metaData(meta:Object):void {
           
            var duration = meta.duration;
            var ratio = meta.height / 480;
            video.width = meta.width / ratio;
            video.height = meta.height / ratio;
           
        }
       
    }
   
}

now in the metadata function its giving me the error, "Access of undefined property video"

Now, am I just completely not understanding how classes work or is this a common problem?

View Replies !    View Related
Accessing Objects Within Objects
Hey there,

What I'm trying to do is somehow assign the same class to a large number of movieclips within another movieclip. The nested mcs are already on stage in the positions that they need to be in. I need to go through all of the 200+ nested mcs and apply the same actions to them.

In AS2.0, I would loop through and do something like this...


Code:
for(var i in someObject){
if(typeof someObject[i] == "movieclip"){
someObject[i] = new objectClass();
}
}

What's an equivalent way of going about this? Any ideas?

View Replies !    View Related
Accessing Parent HTML's Objects
Hi,

I would like to access certain HTML tags' value in the flash.
My flash is embedded in a HTML page and there are several check boxes in the page. When user clicks a button in the flash, it needs to retrieve the value of the check boxes.

What would be the best way of achieving this ?
I am a little desparate ^^ Please let me know !!

Thanks in advance,
Keeyong

View Replies !    View Related
Accessing Objects From Other Embedded SWFs
Hi,

I'm working on a project adapting some stuff and the way it's working leads me to believe they may have had one embedded SWF accessing a global object in another embedded SWF. Is that actually possible, and if it is can someone tell me how 'cause it'd save me a hell of a lot of hassle.

Thanks.

View Replies !    View Related
Creating And Accessing Objects Dynamically
Hi,

I'm experiencing some serious AS2 to AS3 transition problems

I have a movieclip in the library that I place on stage using a custom class. It works fine by all means. The thing is that I want to create six instances (if that's the right word nowadays) that I want to access from other functions (one function is to animate all six instances). My problem is that I would expect all created objects to be accessible via their .name but they are not... Instead, the only way that I can access them is through the variable that I use to create the object instances (var myVariable:myClass = new myClass()). My problem then is that I don't want to predefine six variable names for this (the idea is to make something scalable) and that's when I really get lost. How on earth do I either 1) create dynamic variable names (i.e. "variable_"+i) or 2) access the created object instances on stage (that should be able to get to in one way or another...)?

Thanks a lot in advance.

.cristian

View Replies !    View Related
Accessing Objects Within Instances Of Components
I have my stage, that has an instance of the avpresence component on it,

Basically there are several webcams, all share the same properties but I want one to be different

Right, I can get to some objects within the property using the following code:

_root.mainwebcam_cc.sit_button._x = 10; _root.mainwebcam_cc.sit_button._y = 132;

_root.mainwebcam_cc.seat_video._width = 180; _root.mainwebcam_cc.seat_video._height = 135;

mainwebcam_cc is the instance and sit_button and seat_video are objects within the component, be it buttons or movie clips

There are objects I want to move on the 3rd frame within the timeline (it may or may not get to frame 3 depending on certain things but if it does, I want to be able to move the objects) the above methods don't work, is there something else I need to do?

For example, camBtn_mc appears on frame 3 within the component but

_root.mainwebcam_cc.camBtn_mc._x = 10; doesn't do anything from on the main timeline

I have to do this outside of the component as if I try and position stuff from within the component it affects all instances and not just the one I need to concentrate on.

Dave

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 Display Objects Via The Stage Var
I'm passing a stage reference to my class, but when I try to access a movieclip on the stage I get an error.

this gives me an error:
var mc = targetStage.myMovieClip;

Thanks!







Attach Code

package {
import flash.display.Stage;
import flash.display.MovieClip;
public class MyClass {
private var targetStage:Stage;
public function MyClass ( aStage:Stage) {
targetStage = aStage;
var mc = targetStage.myMovieClip;
}
}
}

View Replies !    View Related
Accessing Objects Across Keyframes And Layers
Hello,

I'd like to have all my scripting in one layer and one keyframe, yet I can't seem to find how to access the instances across keyframes and layers.

for instance, beeing in layer1 and timeframe 1, how to access the objects in layer1 and timeframe 2 ? a concrete example, I have a login screen that navigates to a main screen, and I'd like to make most the main screen components invible for the first navigation.

_root.gotoAndStop(2)
frame2Object._invisible = false
works OK.

however the screen flashes, and I'd like to do
(...).frame2Object._invisible = false
in the init of the flash doc and then
_root.gotoAndStop(2)

is this possible ?

thank you.

Sebastien.

View Replies !    View Related
Accessing Sound Objects From External Swf?
how's it goin'?

I've been having trouble accessing sound objects that are located in an external swf. Essentially I've generated the sound objects in actionscript so that I don't have to link and create movie clips etc - the sound objects are now loaded into an associative array.... The code is similar to

http://www.sonify.org/home/feature/...tesoundobjects/

It plays fine in it's own swf, but as soon as I loadMovie() this swf into another one, my sounds are not playing - nor can I refer to them. How would I go about and access these sounds?? If ya'll have any suggestions please let me know. Thanks

d

View Replies !    View Related
Accessing Properties And Methods Of Like Objects
Hello.

Is there a straightforward means of limiting access to a class's properties and methods to other instances of that class? For instance, say we have two instances of the Example class. Is there a way to allow one instance to access certain properties of the other, but to prevent any instance of any class that is not Example from accessing the same properties? (That includes non-Example classes in the same package as Example- I know about the internal namespace. But I like the way you're thinking.)

I'm tempted to do something with custom namespaces, but I'm not very experienced with them. Any ideas?

View Replies !    View Related
Accessing A List Of Objects Within A Movieclip.
Hi all,

I've been searching around most of the day for an answer, however everything has turned up a blank. So I hope someone can help me here.

I have a movie clip on my scene with a number of objects all prefixed with a keyword 'build' (e.g. 'build8934', 'build4920') - is there any method, array or object that I can access that would give me access to a list of objects for that movie clip?

I'm intending to loop through an add events to an instance which matches the prefix 'build' and set additional properties based off that instance.x.

Thanks and cheers in advance.

Beza.

View Replies !    View Related
Accessing Dynamic Added Objects
I'm building an videoplayer with XML list.
I dynamically add multiple instances of a movieclip from the library (to hold the contents) to a movieclip called Holder wich is on the stage.
The instances are named Disp0 to Disp5.
So far it works out.

But how do I access these instances, my thought was:
Holder.Disp0
Why isn't this working?

View Replies !    View Related
Problem(I Think...) Accessing Instance Objects.
First up, my first post here, so hi to all.

Ok the problem I've got isn't really a bug, I mean the code does what I want so far, but I think I might going about it the wrong way. Simple game, a breakout clone in AS3, although this time I was messing about splitting it up into classes, but was having trouble accessing instances of those classes...

Way I got around it was to... add them to arrays... example, creating an instance of a menu...

Code:
var menuItem = new MainMenu();
menuArray.push({aButton:addChild(menuItem.createStartBtn())});
menuArray.push({aButton:addChild(menuItem.createOptionBtn())});

// some time later

menuArray[0].aButton.x = 10;
That cant be right though can it? I mean I was ok with it when I was sticking instances of blocks and player paddle etc into arrays, but now sticking the menu screen into an array?
Is there a better way of accessing them, other then adding them to an array like that?Or am I just worrying about nothing?

EDIT: Well, doesn't look like I'm going to get a reply to this thread... but no worries, I found a better solution, for anyone else who might suffer a brain fart like I did and finds this, make the external class return an object, and in the main class be sure to have an object variable handy ( var bla:Object; ), just assign the returned object to that, no need for arrays. If object variable has scope, no problems accessing it form anywhere else.

View Replies !    View Related
Accessing Objects Across Keyframes And Layers
Hello,

I'd like to have all my scripting in one layer and one keyframe, yet I can't seem to find how to access the instances across keyframes and layers.

for instance, beeing in layer1 and timeframe 1, how to access the objects in layer1 and timeframe 2 ? a concrete example, I have a login screen that navigates to a main screen, and I'd like to make most the main screen components invible for the first navigation.

_root.gotoAndStop(2)
frame2Object._invisible = false
works OK.

however the screen flashes, and I'd like to do
(...).frame2Object._invisible = false
in the init of the flash doc and then
_root.gotoAndStop(2)

is this possible ?

thank you.

Sebastien.

View Replies !    View Related
Accessing Sound Objects From External Swf?
how's it goin'?

I've been having trouble accessing sound objects that are located in an external swf. Essentially I've generated the sound objects in actionscript so that I don't have to link and create movie clips etc - the sound objects are now loaded into an associative array.... The code is similar to

http://www.sonify.org/home/feature/...tesoundobjects/

It plays fine in it's own swf, but as soon as I loadMovie() this swf into another one, my sounds are not playing - nor can I refer to them. How would I go about and access these sounds?? If ya'll have any suggestions please let me know. Thanks

d

View Replies !    View Related
Accessing Class Objects Instance Name
Hello

I have a class name Contents I am creating 5 objects of this class. Is there a way to keep track of the instance names assigned to the objects. What I am doing is get all the objects of Contents class and make button out of these and when user clicks a button the I want to reterieve descrioption from Contents class but I dont have any mean of storing the instance name. I think I am not making any sense so here is some code

Code:

public class TestContent extends EventDispatcher
   {
      //Class properties
      
      private var _desc:String;
      
      private static  var _children:Array = new Array();

      // Class Constructor
      public function TestContent(name:String, desc:String)
      {
         // I want to store the name assigned to this object so I can use this later
                         this.instanceName = name;
         _desc = desc;
         
         TestContent._children.push(this);
         
      }
      public function get name():String
      {
         return this.instanceName;
      }
   
       public function get desc():String
      {
         return _desc;
      }
            public static function getChildren():Array
      {
         return _children;
      }


So in another class I am using the number of objects of this class to create buttons
Code:

//Some other class

parentSprite:Sprite = new Sprite;
var mArray:Array = new Array;
mArray = TestContents.getChildren();

for (i = 0; i<mArray.length; i++)
{
var mc:MovieClip = new MovieClip(mArray[i])
parentSprite.addChild(mc);
}
parentSprite.addEventListener(MouseEvent.CLICK, onClikc);

public function onClick(e:MouseEvent):void
{
// here I wanna use the instance name of the TestContents object to call the desc property
trace(e.target.desc);
}


I hope I am making sense here

Thanks in advance

View Replies !    View Related
Accessing Objects Into External Loaded Swf.
Hi guys,

I'm loading a external swf and i want add a action to a object into that swf. I have a button into the main swf and when this button was pressed i want than a object into the external swf execute a action. How i can make this.

This is my code so far.

Code:

var placeHolder:MovieClip = new MovieClip()
placeHolder.x = 0;
placeHolder.y = 100;
addChild(placeHolder);

var ld:Loader = new Loader();
var swf:URLRequest = new URLRequest("child.swf");
ld.load(swf);
placeHolder.addChild(ld);

botao.buttonMode = true;
botao.addEventListener(MouseEvent.CLICK, clickHandler);
function clickHandler(mEvent:MouseEvent):void
{
   placeHolder.ld.myMc.x = 150;
}

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
Accessing Built Objects That Are Not In Display List?
I have a routine that loops through an XML file and builds out the necessary sprites. The thing is, I don't want to add them to the display list right then and there. I want to wait for the user to perform an action before adding it to the screen.

What I've done is add it to the stage using the this.addChild(sprite); and then setting the alpha to 0. I dont want to do this.

When I remove the this.addChild(sprite);, I am assuming the sprite is still being built but not added to the display list. How do I access that sprite once the user clicks a button? I can't use this.getChildByName(sprite name); since its not in the display list...

What's the best method to prebuild objects and wait to load to the stage based off user interaction?

Help!

Thanks!!

View Replies !    View Related
Accessing Properties Of Objects Stored In 2D Arrays
I'm looking to put together a bit of code that dynamically scales a field of movie clips based off of the user's mouse movements. I have the code that scales a single movie clip written, and I've filled a two-dimensional array (an array filled with other arrays, which are in turn filled with objects, which have clips attached).

So my question is: how do I access the properties (scaleX and scaleY, specifically) of those movie clips?

Thanks, and much love.

View Replies !    View Related
Problem Accessing Sound Objects In External Swf
how's it goin'?

I've been having trouble accessing sound objects that are located in an external swf. Essentially I've generated the sound objects in actionscript so that I don't have to link and create movie clips etc - the sound objects are now loaded into an associative array.... The code is similar to

http://www.sonify.org/home/feature/r...esoundobjects/

It plays fine in it's own swf, but as soon as I load this swf into another one, my sounds are not playing - nor can I refer to them. How would I go about and access these sounds?? If ya'll have any suggestions please let me know. Thanks

d

View Replies !    View Related
Accessing Values From Dynamic Objects Problem...
I have a loop which creates dynamic objects from a class (MenuBulletClass) and adds it into my container (menu_select_list_container:MovieClip). I'm having problems getting properties/variables back from a specific object for example below.


PHP Code:



   for (i=0; i < 8; i++) {    var menuBulletObject:MenuBulletClass = new MenuBulletClass();    menuBulletObject.name = "bullet" + i;    menuBulletObject.xml_selection = i;    menu_select_list_container.addChild(menuBulletObject);   }    trace(menu_select_list_container.getChildByName("bullet1").xml_selection); 




It throws a "1119: Access of possibly undefined property xml_selection through a reference with static type flash.displayisplayObject." error. I'm really stumped on this and the answer will probably be laughable. Anyone? Thanks!

View Replies !    View Related
Problem Accessing Sound Objects In External Swf
how's it goin'?

I've been having trouble accessing sound objects that are located in an external swf. Essentially I've generated the sound objects in actionscript so that I don't have to link and create movie clips etc - the sound objects are now loaded into an associative array.... The code is similar to

http://www.sonify.org/home/feature/r...esoundobjects/

It plays fine in it's own swf, but as soon as I load this swf into another one, my sounds are not playing - nor can I refer to them. How would I go about and access these sounds?? If ya'll have any suggestions please let me know. Thanks

d

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
Copyright © 2005-08 www.BigResource.com, All rights reserved