ActionScript 3.0 :: Getting 1061 Error With HitTestObject
Sep 1, 2010I'm getting a "1061: Call to possibly undefined method hitTestObject through a reference with static type Class." error with this[code]...
View 9 RepliesI'm getting a "1061: Call to possibly undefined method hitTestObject through a reference with static type Class." error with this[code]...
View 9 RepliesIm trying to use the hit test built into flash, but its failing. I have used this many time before! but this time flash is crying at me. I Think i know why but im not sure how to fix it. Here is my hit test code:
[Code]....
I have tried multiple things, Changing instances, location of the code. I currently have 4 classes, Main, Missile, Enemy and House. House has nothing it in really. Missile make a missile, Enemy Makes a enemy. And main deals with adding it all to the stage, and making it randomly appear ect.
Code is working but i am getting the following error and it is driving me insane:
TypeError: Error #2007: Parameter hitTestObject must be non-null.
at flash.display:isplayObject/_hitTest()
at flash.display:isplayObject/hitTestObject()
at PlatformGame/checkCollisions()
at PlatformGame/gameLoop()
Here is my Frankenstein code...i just need it working. Error happens when I remove the numOfKeys-- where I examine the level. Had to remove some code because of length when posting here on FK.
I am a newbie with Flash CS4 and via a tutorial of Lynda.com I am trying to make my first website. With the exercise files of Lynda I had no problem, but with my own .psd file I am getting error 1061 after I tried to make a mouseEvent.I noticed that in the actions script the word "eventListener" stays black instead of changing into blue.
This is the action script:
Actionscript Code:
stop();//handle events for buttons...about.addEventlistener(MouseEvent.CLICK, clickSection);function clickSection(evtObj:MouseEvent){//trace shows what's happening... in the output window trace("The about button was clicked!")}
See attached screenshots for more info.
I've a 1061 problem with a custom class. My class is named lingua here the code: [URL] I've imported it in my main class but when i delcare a variable like this:
Code: var a:String = lingua.getLang(); It gives me a 1061 error that says to me "call to a possibly undefinited method getLang(); Here the main: [URL] The problem stays in the function bottoniLingua at line 155. In fact i've commented the code. but i need those lines because i use them to check the language.
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:
[Code]...
My class is named lingua here the code: http:[url]....I've imported it in my main class but when i delcare a variable like this:
Code:
var a:String = lingua.getLang();
It gives me a 1061 error that says to me "call to a possibly undefinited method getLang();
Here the main: http:[url]....The problem stays in the function bottoniLingua at line 155. In fact i've commented the code. but i need those lines because i use them to check the language.
I've created a button under the SimpleButton class named button1 in Flash CS4. I've set button1 so it exports to AS3. I keep getting an Error 1061 at line 3 of which I have no clue what I'm doing wrong:
Code:
1 import flash.events.MouseEvent;
2
3 button1.addEventListener(MouseEvent.MOUSE_OUT, link1);
4
5 function link1(MouseEvent)
6 {
7var one:URLRequest = new URLRequest("[URL)");
8navigateToURL(one, "_self");
9 }
Error 1061: call to a possibly undefined method addEventListener through a reference with static type Class.
Error 1061: Call to a possibly undefined method _initRemoteClassAlias through a reference with a static type ClassSo, that being said, here's what I think I know about that. It is tying to call a method named _initRemoteClassAlias but cannot find it. So here's my guess where my confusion/problem comes in. The method it is trying to call was created utomatically by FlashBuilder in the _Super Class of a PHP script I have written. (in this case the error is stemming from : services.cascobackend._Super_CASCOBackend.as) - Here's the first little bit of code from the _Super Class in question:
package services.cascobackend
{
import com.adobe.fiber.core.model_internal;
[code].....
I'm getting this error:
1061: Call to a possibly undefined method resizeBox through a reference with static type flash.displayisplayObject.
on this line:
Code:
public function resizeArea():void
{
for(var i:int = 0; i < this.numChildren; i++)
[Code]....
On my content layer, I have information that changes on frame 20, 40, and 60. I want three buttons that will take you to each frame, but even a simple task like that is giving me trouble.
I defined one button as "Seven_btn" and wrote the following code, which results in error 1061: Call to a possibly undefined method addEventListener through a reference with static type Class.
Seven_btn.addEventListener (MouseEvent.CLICK, Seven);
function Seven(event:MouseEvent):void {
gotoAndStop(20)
}
Im getting an error whilst trying to add an event listener to a class of a Button on my stage.
1061: Call to a possibly undefined method addEventListener through a reference with static type Class.
On my stage i have a Button with the instance name stopBtn, this is also exported to an actionscript class called classes.stopBtn (stopBtn.as in a folder called 'classes'). The button is on the first keyframe in the main timeline, in a layer with other buttons on that layer
[Code]...
Scenario: Click on button and timeline animation plays (the animation is a panel that rotates from the back to the front) Error: Scene 1, Layer 'actions', Frame 1, Line 11 1061: Call to a possibly undefined method play through a reference with static type Function. What does this error mean and what code needs to be added to fix it?
Code: Select allimport flash.events.MouseEvent;
bullet_btn.addEventListener(MouseEvent.CLICK, bullet);
function bullet(event:MouseEvent) :void
{
spinbul_pt_1.play();
}
function spinbul_pt_1(){
bul_pt_1_MC.play();
}
I created a simple button that I imported into the stage that I named and saved it as Microwave_btn and I wrote a simple script for it that says:
stop();
import flash.display.*;
import flash.events.*;[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.
Scenario: Click on button and timeline animation plays
Error:
Scene 1, Layer 'actions', Frame 1, Line 11
1061: Call to a possibly undefined method play through a reference with static type Function.
What does this error mean and what code needs to be added to fix it?
[Code].....
how to make a dynamic unfilled and filled circle. that will take input from a slider to dertermine how much of the circle is drawn. I wanted to use this for a preloader. Unlike the author I would like to use it inside of a document class. I am getting 1061: Call to a possibly undefined method createEmptyMovieClip through a reference with static type document. and 1120: Access of undefined property circ1. The second is caused from the first. How would I get this to work in my document class?
//original code
// x: circles center x, y: circles center y
// a1: first angle, a2: angle to draw to, r: radius
// dir: direction; 1 for clockwise -1 for counter clockwise
[Code].....
I'm attempting to create an XML image gallery complete with progress bar and combo box, from a tutorial in a textbook. The tutorial in the book calls for the use of simple buttons, but I wanted to use my own instead. I wasn't aware of the difference between using simple buttons in code and custom buttons, so when I debugged I received the good old 1061: Call to a possibly undefined method addEvenListener through a reference with static type flash.display:SimpleButton.Obviously my decision to use a custom button in it's place is to blame, but how do I modify the code so that it still does what I want only with a custom button?Here's my source code:
Code:
import fl.data.DataProvider;
Pull image information from XML
var xml:XML = new XML();[code].....
I was following this tutorial [URL] and I recieved this error C:UsersDevDesktopcoursework flashClassesDocumentClass.as, Line 271061: Call to a possibly undefined method setFinalScore through a reference with static type GameOverScreen. I am not too sure what that is referring too, I am also using Flash CS5
View 1 RepliesI'm getting the following error when trying to do collision
[Code]....
Error 1061 Call to a possible undefined method addEventListener through reference with static type Class
source:buttonsMenu.addEventListener(Event.ENTER_FRAME, moveMenu);
import flash.media.Sound;
//Setup sound object
var s:Sound = new Sound();[code]....
I cant run this code, it throws an error:[code].....
If you have numerous methods in a class, can you just call them like so:
// in the .fla file
var john:Person = new Person(63,150); // creates a new person named john 63" and 150lbs.
john.weight(180); // changes johns weight to 180lbs.[code].....
I must be calling the method completely wrong? I get this error: 1061: Call to a possibly undefined method weight through a reference with static type Person.
I got this Error : 1061: Call to a possibly undefined method addChild through a reference with static type Class.
what I'm trying to do :I have create a new class called Graph and make it extends Sprite and add a scroolpane to my stage and make an empty movie clip called content_mc and make the source of the scrollpane equals to content_mc
in the first frame i wrote this code
import Graph;
var graph:Graph = new Graph();content_mc.addChild(graph);
When I use the following code inside a keyframe in a layer (Actions layer) it works fine. When I use it inside a custom class I get the following error: .../siteLoader.as, Line 19 1061: Call to a possibly undefined method load through a reference with static type Loader.
[Code]...
I have this kind of problem:
Code:
if(activeBtn != null) activeBtn.hideSubMenu();
here i check if the activeBtn is a different than "null" and than i want to call this method - who's existing and it's with "public" definition.
But no matter what i chaking there's always pop this Error "1061: Call to a possibly undefined method hideSubMenu through a reference with static type flash.display:Sprite."
I'm new to ActionScript but I've been following Lynda tutorials and tried to tailor them to my game. I simply want to make my character at the top of the screen shoot at enemies below. The error I'm getting when I press the shoot button is "Parameter hitTestObject must be non-null." I've read some other forum posts on this error for ideas but still can't seem to make mine work.
{
import flash.display.MovieClip;
import flash.events.Event;
[code]......
I am developing a target game with Touch Event so that you can use-up all your fingers, but I can't remove the enemy from the stage. I'll paste the code
public function onTouchBegin(e:TouchEvent):void
{
var dot:Sprite = this.getCircle();
[code]........
I am working on a fairly simple drag and drop based Flash piece and I have come across an Output Error which I was hoping somebody could give me a better understanding of.As a very brief back-story to my problem, I have two borders on both the far left and right of my movie and the alpha is set to 0 on both of these MovieClips; now I have labels within the movie and I am using the hitTestObject command with an IF statement stating that should the label_mc hit either border1_mc or border2_mc on Mouse Move then execute some code; my problem is that in my Output panel I have now received the error:
TypeError: Error #2007: Parameter hitTestObject must be non-null.
I am not sure about this particular error and would be interested if anybody had any ideas on a fix or solution as I want to understand what is going on with this; I read around some forums which said that when you use hitTestObject the console is listening out for the intersect and that if you move on to different labels later in the movie if the MovieClips you intend to hit aren't present throughout the piece it may cause this error (but I might and probably am wrong).
I want to save XML File using Flex 4 SDK
var fr:FileReference=new FileReference();
fr.save( newXmlRow, 'D:/Sample.xml' );
Error Shows :
1061 "Call to possibly Undefined method save through a reference with static type flash.net:FileReference"
I don't get any compiler errors, but I do however get the message: TypeError: Error #1006: hitTestObject is not a function. does anyone no the common cause of this? If you need me to post my code I can do that to.
View 1 Replies