For some reason I can't add event listeners.. I've searched the error but people say it's due to having the addEventListener outside of a function. However mine is inside the constructor!
package { import flash.events.*; public class keyClass {
I'm creating an interactive map for a final project, and I'm terrible at coding. My code is returning a lot of "Access of undefined property" of buttons, and "Call to a possibly undefined method addEventListener through a reference with static type Class".I have movie clips that are boxes that are supposed to animate over the map when a button is clicked on, and they have buttons inside of them that have boxes that are supposed to replace the one that is on screen when clicked. [code]it won't let me post the link for my .fla,
I'm trying to add an event listener to the end of a motion tween in AS.
I've created a tween, highlighted the frames, right clicked and copied the tween as AS and pasted it into the movie clip (I think there's a better way to do this, but I'm not sure what it is...)
When I try to add the listener to the end of that code, I get the error. Here's my code.
The properties for the Microwave_btn has the class labeled as: Microwave_btn and the Base class as: flash.display.SimpleButton. When I test the movie I get this error:1061: Call to a possibly undefined method addEventListener through a reference with static type Class.
I try to make working an XML loader from a custom class on a new var, but when I add an Event listener it tells me this:
1061: Call to a possibly undefined method addEventListener through a reference with static type XMLLoadData.
This is the code I have on the stage:
Code: var xmlLoad: XMLLoadData = new XMLLoadData("navigation.xml"); //load the xml file xmlLoad.addEventListener(Event.COMPLETE, onComplete); // execute onComplete once the xmlLoad is fully loaded function onComplete(e:Event):void{ // }
and this is the code of my custom class XMLLoadData Code:
I have a RemoteObject returning a 'Schedule' class. I've created a client side RemoteClass to map to it. All properties of the class instance are coming in fine. I just not clear on how I go about calling methods on the class. How would I call a setter on startdate?
package classes.remote { [Bindable] [RemoteClass(alias="com.site.data.schedule.Schedule")] public class Schedule { public var id:int; public var modifydate:Date; public var startdate:Date; public var enddate:Date; }}
Is there a way to make an static method act over an object of its class that is already on the stage, without using the keyword "this"? I mean, like "generic object of this class: do what I'm telling you to do, wathever your instance name".My goal is to create an method that get called by any object of this class, based on the changing on the value of an external variable, but since I cannot use the "this" keyword to reffer to each instance, I could not figure out a solution.
This error only appears on one var! It didn't happen earlier. Why is this occuring? size_ns is a Numeric Stepper.the error:
Code: **Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 52: There is no method with the name 'addEventListener'. size_ns.addEventListener("change", styleListener); Total ActionScript Errors: 1 Reported Errors: 1
ActionScript Code: mc.addEventListener(MouseEvent.CLICK, OtherClass.method); I always had to call a local method that dispatches event to the instance of the OtherClass...
I'm trying to split off my game's control code into a new class. code that previously worked as part of the main timeline, is now not working and I'm not sure why.My full Control.as can be found attached to this post. The part I'm specifically having a problem with is adding event listeners:
I am new to CS4 and coding. When I test my movie it keeps going through my pics as a slide show. I just want the large pic to stay still and change when i click on my thumbnail size pics. What I noticed is that addEventListner should be blue and is not. and here is my code:
I want to do something quite simple, but am new to AS3 and the changes since AS2.I want to click a button (play_btn)Then when this happens it opens a SWF (movie.swf) into a placeholder (placeholder_mc) onto the stage. That's it!
play_btn.addEventListener(MouseEvent.CLICK, placeholder_mc); function placeholder_mc(event:MouseEvent):void{ trace("pressed"); loader.load(new URLRequest("movie.swf")); }
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.
Flex complains if I want to create an object from a library symbol with linkage: 1180: Call to a possibly undefined method [linkage name]. So to avoid this, I create a class for that symbol, in this case extending BitmapData using Flex's new ActionScript Class feature. Flex create that class for me and the constructor looks like this: public function CustomBitmapData(width:int, height:int, transparent:Boolean=true, fillColor:uint=null)
I need to get a javascript var in my Flash application. I like to be able to just set a variable in the javascript (client constraints) rather than define a function.
Can this be done? I am trying to use the ExternalInterface.call()
I have a class. I can call the constructor (initialize the class), and the constructor can then call a function/method inside it's own class (so I know it works), but when I try to call the same function/method myself from the instance of the class I just initialized, I get an error.
I have an issue with my eventListeners with the URLLoader, but this issue happens in IE, not in FF.
public function getUploadURL():void { var request:URLRequest = new URLRequest(); request.url = getPath();[code]....
The issue is that my getBaseURL gets executed automatically after I have executed the code at least once, but that is the case only in IE. What happens is I call my getUploadURL, I make sure the server sends an event that will result in an Event.COMPLETE, so the getBaseURL gets executed, and the listener is removed. If I call the getUploadURL method and put the wrong path, I do not get an Event.COMPLETE but some other event, and getBaseURL should not be executed.
That is the correct behavior in FireFox. In IE, it looks like the load() method does not actually call the server, it jumps directly to the getBaseURL() for the Event.COMPLETE. I checked the willTrigger() and hasEventListener() on _loader before assigning the new URLLoader, and it turns out the event has been well removed.
I simplified my code. To sum up quickly: in FireFox it works well, but in IE, the first call will work but the second call won't really call the .load() method; it seems it uses the previously stored result from the first call.
I created an FLA file that has a control bar (with play, pause, etc.) that I want to appear only when the mouse is moved onto the stage. When the mouse is moved off the stage, I want it to fade.I used the code below but it seems that the MOUSE_OVER event is only captured when the mouse is moved over some object on the stage. When the mouse is over an unused part of the stage, the event is not fired and the control bar remains invisible.barBg_mc is the name of the control bar in the code below.
I just wanna add an image from my library on the stage and have an event listener on it so when i click on it, it will do something. imgFromMyLib is already set to the image i want from my library.