xml_object.childNodes.length will return the number of childnodes there are. But I don't see a way to get at the number of childnodes of a particular type. This will not tell me, for example, how many childnodes of type "b" that "a" has. I can't see Flash XML support being this sparse. Is there a built-in way of accessing the nth child of a node of a particular element name or am I stuck with accessing it only by number.
I have a initApp.as which instantiates a class which needs to access the "currentState" property and the States array as well. However we cannot get this to work as we cannot see how we can access this information.
Within initApp.as currentState is accessed via "this.currentState". This does not work in the class which is instatiated within initApp.as. The following error is thrown:
i wonder why i am unable to access the public properties of this custom class the public var w:Number; and the Public var h:Number; i am tracing them and on an instance of the PreLoader() Class.. and ia m getting NAN;
I will be choosing which mask to use based on users selection of puzzle piece.When I try to use traingular mask by adding puzzle.gotoAndStop(2) the swf just flickers. Thought the holder_mc and mask_mc are exactly of same dimension one comes below lower than other though I have not altered the position of the clips within a puzzle piece.If you want to take a look at my fla here it is https:[url]....How to go to a specific frame 2. Why is position of two clips inside the piece changing
I'm trying to create an XML class to load some images on a stage, but my problem is that I can't access variables in my XML class(which I need to load the images) from the main timeline after I've created a new instance on the XML class.[code]...
I am just writing this test code in AS1.0. Now the problem, I am not able to get access to my class variables. I am doing this stuff for learning As1.0. Although in 2.0 I get through those using static variable. But in As1.0 I don't know how to do this.
I have a MC with a class attached to it, and I have other MCs within that MC. I need those MCs to be able to access variables within the main MC class. Here is a quick'n'dirty:
Code: class Foo extends MovieClip{private var h:Number; private var subMC:MovieClip;function Foo(_h:Number){h = _h;} subMC.onEnterFrame = function(){trace(h);}}
How can I access variables in the Foo class from another MCs scope? I have tried using static var but aren't they constant regardless of instance?
I have basic knowledge of Flash and AS3.0. Suppose i have a flash swf file(main.swf). In this main.swf file, i loaded another swf file(sub.swf) by writing the following code snippet in main.swf file as shown below:
var textLdr:Loader=new Loader(); var noteUrl:String = "AddNote.swf"; var noteUrlReq:URLRequest=new URLRequest(noteUrl); textLdr.load(noteUrlReq); addChild(textLdr);
Now, how to acess the data present in main.swf into sub.swf.Note: Here data represents values/data stored in variables/objects of main.swf file.
Anyways, I've been trying to figure this out for quite some time.Let's say I have my document class. I'm guessing the document class can correspond to the first thing that gets run? (such as the "main" function in most C++/low level languages).If I set a variable in it:var myNumber:Number = 10;how would Iaccess: "myNumber" from other objects in my stage?Like a movieclip on my stage for example.If I go inside that movieclip into the movieclip's first frame, how would I say:trace(TheDocumentClass.myNumber);Another similar question is, what about the actual stage frame?If I click on frame 1 of my stage, set a variable:var aNumber:Number = 5;how would I access it from other objects?In my movieclip's first frame, what would I put?trace(root.aNumber); ?trace(stage.aNumber); ?
C:alexflashportfolioimagesDualGallery.as, Line 15001: The name of package 'portfolio.images' does not reflect the location of this file. Please change the package definition's name inside this file, or move the file. C:alexflashportfolioimagesDualGallery.as
My class file is located here: C:alexflashportfolioimagesDualGallery.as My class file is defined as: package portfolio.images {.....
My FLA is importing it as : import portfolio.images.DualGallery;
Normally I use portfolio.classes and I have no trouble. My AS3 prefs are set to the alexflash folder.
This code works perfectly the way I want it to. However, I am having a very difficult time splitting this code up. What I want to do is take the function PlantGrass and place it in another action script file [URL] to help organize my functions and classes. I tried putting the PlantGrass function in the second file, but I can never get it to work.
I've created a class that utilizes setInterval...I call it in a different class...and I can't get it to make the setInterval call. I'm thinking there's a scope problem but I don't see it.
Class w/ setInterval:
Code: class Foo { private var id:Number; public function Foo() {[code]....
The function will get called but I need access to the class's instance variables inside display().
I'm porting a Tetris game I created in Javascript to Actionscript to get a little Flash/AS experience.
I have my main flash file, TetrisMain.fla and TetrisMain.asI put the main background image of the playing field onto the stage here. It displays correctly.
I have a file called TetrisBoard.as ( keeps track of score, level, current row etc)
I have a file called Tetraminoes.as
I inserted a "block" jpg into the library. I inserted a movie clip "Block" into the library, and dragged the block.jpg onto it. When a new Tetraminoe is created in the constructor, it creates "new blocks" which are the tetraminoe blocks. [code]...
I add the sprite to the stage and define it's x and y in the class file. How would I go about changing the x and y of the container within my fla file?
I wrote a custom class and I need it to change the attributes of movie clip for me, not sure how the syntax goes, this is what I thought was right, but om a newbie:
It seems simple, but it doesn't seem to be working I have 2 as3 files as classes "mainclass.as3 (this is the document class)" and GamePlay.as3
the GamePlay class works flawlessly on it's own, but when i try to create the var to access it ... var gp:GamePlay=new GamePlay(); ... i get the following error.
I have looked at tutorial etc, but i cant get it to work i am currently getting the following error.[code]...
I have the livedocs wide open and I still can't figure out how to send off multiple variables in an object (from a class) to the FLA file...[URL] The setup: I have a class that extends EventDispatcher. I created an Object called _pass, public var _pass:Object;. In my last function (everything is cool up until now), I have four variables that need to be passed to the main fla. Let's say they're param1, param2, param3, param4.
It was explained to me that I could use the public var _pass:Object; by first creating an instance of the object like so, _pass = { param1, param2, param3, param4 }; (each param is available in the function). Having setup an object instance, I could then dispatch the object to read from within my fla: dispatchEvent(new Event(Event.COMPLETE));.
But I get these errors:
1084: Syntax error: expecting colon before comma. 1083: Syntax error: rightbrace is unexpected.
As the livedocs show, you can use an associative array (with braces and a colon), but I don't need that. I just need to pass my variables that are pre-made to the FLA.
I want to know how you access a variable within the fla file from the Document class?I want an int inside the fla or swf file to be accessed from the class that is being used to run the file?
I have searched for this everywhere but it seems like every answer is either overcomplicated or simply does not work, and I know for sure there should be a more simple way of achieving what I need. So, until today, I have always coded from within the timeline. But now I realise why I should code in separate class files. However, I still want to include snippets of code in the timeline for simplicity's sake.
I made a movie clip that is linked to a class named "Fugel". In the "Fugel" class I want to access the object's properties (x, y, rotation, alpha...) that I created in the main FLA file. I'm trying to center it in the constructor, but I don't know how to. The "this" keyword doesn't seem to work.
Here is the code for the "Fugel" class:
Code: package { import flash.display.MovieClip; public class Fugel extends MovieClip { public function Fugel() {
I have an as3 component I made in CS3 and need to access the Component Definitions. Defining component parameters using the Inspectable Tag metod does not return success.
I am currently using an external Class file for an instance in my .fla project. It creates an instance of that specific class and has it carry out some functions.I want to access a MovieClip on the stage in the .fla file in the external Class file. How can I do this?For example, the Class file creates an instance of that class, and I want the x and y coordinates of that instance to be equal to that of let's say circle_mc. Now circle_mc is on the stage of the .fla file, and therefore cannot be accessed. How can I get around this?
I have an Existing FLA file (It is my Project file) and I have downloaded one good example Class file with Fla. But there is no code at all on the stage just it is retrieving instructions from the Class. How can I use this class file in my existing fla file.
I'd like to access the stage of the main timeline from w/i a class that extends a movieclip. Basically, I have a button in the main timeline that makes a HUD appear. The HUD is an extended MovieClip class. When people click on a button in the HUD, I'd like to remove the object from the stage of the main MovieClip.I think your confusion may come from the fact that I am running this code from a class definition file. Clicking on a button w/i this object should remove it from the DisplayList of the MainTimeline. Here's the code from the class definition file:
trace(e.currentTarget.parent.parent) gets me the MainTimeline, and trace(e.currentTarget.parent.parent.stage) appears to return the main stage, but I cannot use removeChild w/o getting an error that I am trying to coerce the stage to be a DisplayObject (which it ought to be).What's on the stage of the MainTimeline: A single button that, when clicked, adds an instance of the Answers class to the stage.
I have extended an mxml component with an actionscript class. I'm trying to access a component in the mxml file using the id (in order to add an event listener) but I cant seem to do it.
I get:
TypeError: Error #1009: Cannot access a property or method of a null object reference.