I've got two classes running...one is a document class (EgoGame.as) and another is a class linked to several similar movie clips (Ball.as).I'm trying to access a public variable from Ball.as which has been declared in the doucment class EgoGame.as.When I run the test the outputs states the following...1120: Access of undefined property _ballPlaced.Here's my code. What I'm trying to do is remove the event listeners from the Ball.as when the _ballPlaced variable is true, so that the user can't drag and drop the balls after they've been placed in a zone.
I've created 2 public variables in my Document Class...
public var _wall1:Wall=new Wall();public var _wall2:Wall=new Wall();I've then added them to the stage and given them relevant instance names...
stage.addChild(_wall1);_wall1.x=32; _wall1.y=510;_wall1.name = "wall1";I then want to use these variables in another Class (Ball.as). They need to be accessed in a function within the Ball Class constructor.
function bubble(event:Event):void{if(this.hitTestObject(_wall1)){ this.x += 1;}else if(this.hitTestObject(_wall2)) { this.x -= 1;}However, the following Error message keeps appearing...
1120: Access of undefined property _wall1.1120: Access of undefined property _wall2.Any pointers? Do I need to import something into the Ball Class to point to the _wall# public variables in the Document Class?
class Base { public var space:Number; } which gets extended by class Desc extends Base {
[Code]...
This doesn't compile. Say, you don't have control of the base class, what ways is there implement the same thing? The obvious is create a function setSpace(), but this object is being embedded in an already existing system that use the public space.
finally have a working hitTest (YAY!!!!), now, my code is setup to create 3 'sasquatches', the problem is for the hitTest to work, the variable "one" has to be public. Now, in the next bit of code we create 3 instances of one using a for loop, BUT they all three are in the same spot cause I can't figure out how to pass Random numbers to the variable each time it creates.
I think I've made some fundamental error here... I have a public variable a in class A, and I want to access it in class B, but I cant (access of possibly undefined property...) now every time I want to refer to a variable in class A I need to pass the variable reference to class B's constructor
I have a simple problem. I have two document classes. One is Main.as the other is Step2.as. I want to declare a public variable in Main.as then need to give it a value from Step2.as. That value will later be used in my next Document class Step3.as How would I write the code that gives the value in my Step2.as and then how would I write the code that retrieves the value in my Step3.as?
Note I can't import my Step2/ or Step3 document class into my Main.as.
Let's say I have a class, and I created a new object of this class in my document class. Inside this class, there is a public variable. How would I be able to detect a change in that public variable?
What would be the scoping to reach a variable within a external class public function FROM a function on the main timeline?In menu.as public function buttonClick()Need to reach a starFunction variable(var starFunction = such and such.@fn) within an if statement within buttonClick function.On main timeline(menu.as declared on first frame main timeline as var menuH:Menu = new Menu()In function aboutUs()here is where I need to use that variable for an if statement
i've got two classes and i'm not extending to MovieClip. I like to attach the mc in the constructor just because i'll be working with different MC's that have the same purpose.
however, im using private var loadedMC:Movieclip and now i've got another class that needs to be able to access the instance's variable.
for example, myClass.loadedMC , but this would mean having to make it public and I rather not go that route.
I have the below script as part of a small application I'm building. The script just creates cue-points along a movies timeline so we can add events etc to those cue-points.
[Code]....
It's creating the cue-points well, although I'd like to use the below variable outside of this function.
Code: var stampName When I try and use it I get an access of undefined property error, which I believe relates to the variables being private and within the function - but I can't seem to find a method to get this varibale public.
I'm trying to extend a class like panel so that I can fire click events only when the title area is clicked on. The title area is a protected uicomponent of Panel called titleBar. So I want to make that component public.It seems like I'm almost there but I'm getting a "TypeError: Error #1009: Cannot access a property or method of a null object reference." when it tries to add an event listener to the titlebar.
here is my extended panel
package custClass{ import mx.containers.Panel; import mx.core.UIComponent; public class ExtPanel extends Panel{
I want to make a TextArea component public so it can be accessed from other frames. For example, I want to be able to say that if this button is pressed change the TextArea text to "1" and go to the frame.
I have no idea how to do this, i've tried : frameHome.textArea.text = "1"; to change the text but it doesn't work so i'm presumming that i'm a little off mark.
I am trying to create a public function, i have a decument class with all of my variables in it, I have worked out how to bring in external .swf files, now I need a way to have an even trigger something on a separate .swf So at the moment I have a flunction that works on the parent
stage.addEventListener(MouseEvent.MOUSE_MOVE, mousePosition); function mousePosition(event:MouseEvent) { if(mouseX>=125)
I'm tryng to make a public static method call another method, but Flash throws error 1180, sayng that the method called by the static method is undefined.
The Idea is i want to make avariable that stores his value after i close the swf and open ti again,
an example:
i make acounter
var i:int = 0; var timer:Timer = new Timer(1000); timer.start();
[Code]....
the value of i will increase but after i close the application and open it again the value will return to 0 , keep the variable stores his value after closing the application ?
I've searched around and wasn't able to find any solutions to my problem, which probably just means I'm going about this wrong way, but here it goes...I have a bunch of variables named like so:box0Wbox1Wbox2W
I'm using a filter I got through [URL]. This filter provides a transition effect between images.
My navigation is a set of thumbnail image buttons that change a central larger image to match the particular thumbnail. The central image displays the image matching the last button clicked and the transition must be from that image to a new image matching the user-selected button.
What I would like is to be able to assign the first image in the transition to a variable. Can that be done with ActionScript 2.0?
My file: [URL](click on the red globe icon on the right to see the page (of flower images)).
Primitive types in AS3 pass by value instead of reference. Is there a way to override that behavior and pass by reference for certain variables? [code]...
I'm building a website that is basically an art gallery. I have a movieclip that I'm placing dynamically Code:[code]This wall movieclip is basically a wall background image with artwork hung randomly at different sizes and locations... more of a collage vs a grid.I've manually placed the artwork mc's on the wall since it's such a random layout. Each artwork mc has an instance name of "art1" "art2" etc.I thought about trying to use xml, but since I'm not dynamically loading the thumbnails, I don't know how I would reference the thumbnail to the full size image?when you click on the mc "art1", make "art1" the value of the variable "currentArt" then look at the loaded XML and populate a DetailView_mc with:art1 info.[code]
I'm trying to use a variable and make it assume a different value acording to the option selected on the combobox and it's been hell for me.
Supose I have a variable named "favouritesport"... I would like to have a combobox with 3 items (baseball, football, basketball). As you choose one of the sports the variable should change.
Ex. If someone chose baseball than it woul make favouritesport=baseball