ActionScript 3.0 :: Call To A Possibly Undefined Method Splice
May 19, 2011i get the above error when I try to use splice on this code:[code]I'm not that great at actionscript, do I have to import something for it to work?
View 3 Repliesi get the above error when I try to use splice on this code:[code]I'm not that great at actionscript, do I have to import something for it to work?
View 3 RepliesI've just upgraded to CS4 from CS3, and the AS3 project I'm working on which was compiling perfectly well in CS3, is now failing to compile because of a variety of errors.I can solve some of them by casting:
ActionScript Code:
// before
if(clip.stage != null)
// after
if(DisplayObject(clip).stage != null)
But I'm failing to solve them on errors regarding Arrays:
ActionScript Code:
// measurements is an array in both cases
measurements = measurements.splice(index, 1);
// 1180: Call to a possibly undefined method splice.
for(var i:int = 0; i < measurements.length; i++)
// 1202: Access of undefined property length in package measurements.
I'm surprised than a fresh install is behaving like this. Is there some setting somewhere I've not enabled?I set the flex sdk path to the same one that I'm using in Flash Develop, but no luck.
I am getting this error: 1180: Call to a possibly undefined method startWorld.but the method startWorld is defined as you can see in attachment.
View 4 Replieswhy this is not working.I have an application with a new class I just created. The class loads, but will not call it's own internal function.
package com.parkerandkent.components.classic.photogallery {
import caurina.transitions.Tweener;
import flash.display.MovieClip;[code]....
"Test 2" will not fire here.And I get this error message:
CallTag.as , Line 10 1180: Call to a possibly undefined method init.
Call to a possibly undefined method LibraryItem? The following code throws this error[code]...
View 2 RepliesOn my main timeline I have the code:
[Code]....
Both of the files are in the same folder, but it fails to run and constantly comes up with the error: Call to possibly undefined method startfyp. Like I said, I am extremely new to programming, and I'm sure the answer is probably really obvious.
I have a custom class called ToolBar which is attached to a library item. The library item has other clips within it and each is an instance of ToolBarButtonA, B, C etc and these all extend the generic class ToolBarButton. If I set an event handler for CLICK within each ToolBarButton to trace 'parent' it comes back [Object ToolBar] which is what I expected but if I try to then call a method through 'parent.methodName()' it fails saying 'call to possibly undefined method'
View 9 Replieswhen i use addChild method in my class I got this message . Why it shows error "Call to possibly undefined method addChild"
View 3 RepliesIn Flash CS5 I am trying to load an image from a class and I am getting Call to a possibly undefined method addChild. In the class fileNot sure how to fix this as I have a sprite class and believe I have done everthing correct.The image is in the same folder as the .fla and .as file
[Code]...
Those files are in the same folder:
my .as file
package {public function YAAY():int{return(3);}; }
My main .fla
trace(YAAY());
But the compiler says
1180: Call to a possibly undefined method YAAY.
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].....
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 {
[Code]....
I am struggling with this bit of code in AS3,
stop();
next_btn.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler141);
function mouseDownHandler141(event:MouseEvent):void {
gotoAndPlay.nextFrame();
}
It is coming up with this error:
1061: Call to a possibly undefined method nextFrame through a reference with static type Function.
I had this function checkParameters as public static, but then i decided that this should be private, and now its giving me that error.why this cant be private?
Code:
package com.tean.utils{
import flash.display.DisplayObject;
[code].....
I've decided to move on to AS3 (and maybe AS4 in the future). I've done PHP object oriented programming and Java oriented as well, but Flash is a bit different because of actual visual things that occur.
I tried to follow a very simple tutorial. I made a "collector" MovieClip and added both the identifier "collector" and the class "collector" to it. I added the project class as "superClass".
In superClass.as I had the following lines of code:
ActionScript Code:
package {
import flash.display.MovieClip;
import flash.display.Sprite;
[Code]....
is to an undefined method. I don't really see how this could be, since I have the collector class.
i encountered this error... and i dunno wat to do.. the following are my code in actionscript:
[AS]package {
import flash.display.*;
import flash.text.*;
import flash.geom.Point;
import flash.events.*;
[Code]....
I've got a function that call's on a class too make a chess board. The problem is, is that I'm getting this Error:1180: Call to a possibly undefined method addChild.Now if I just copy paste CreateBoard into Exercise1.as it works and creates a board but if I add it as a function too BoardSquare it works and traces out 32,32 but doesn't display anything![code]
View 9 RepliesI'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,
View 5 RepliesSo I just started programming with flash and I'm a little confused. When I compile this i get an "Error: Call to a possibly undefined method methodName" for beginFill, drawRect, and endFill.
I think I need to tell action script what to apply the methods to, but I'm not sure how to do that. And why doesn't the "add" method need this?[code]...
I'm following the Advanced After Effects for Flash tutorial, but run into some errors. I've pasted the Caurina map into the same folder as where my .fla is located. Description:1046: Type was not found or was not a compile-time constant: Over.1180: Call to a possibly undefined method Over.
My script
Code: Select allimport caurina.transitions.*;
btnTV.addEventListener(MouseEvent.ROLL_OVER, btnTV_ROLLOVER);
[code].....
This should be simple, but i can't get it.
A) on the timeline of my .fla file i have:
var pt:MovieClip = new RoadObstacle();
addChild(pt);
//
stop()
B) In my library I have an MC with a linkage of RoadObstacle.
C) I have an AS file called: RoadObstacle.as
It works as long as the .as file is right next to the .fla file. I move the .as into folder path com.screenscape.game - I update both the .as package path and the path for the library symbol in the .fla - then run it and i get:
1180: Call to a possibly undefined method RoadObstacle.
I'm trying to get a jpg image from the fatcloud swf - am getting the following error
1180: Call to a possibly undefined method createJPG.
Actionscript Code:
public function createJPG (m:MovieClip, q:Number, fileName:String){
var jpgSource:BitmapData = new BitmapData (m.width, m.height);
jpgSource.draw(m);
var jpgEncoder:JPGEncoder = new JPGEncoder(q);
var jpgStream:ByteArray = jpgEncoder.encode(jpgSource);
[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]....
in my AS file I have the code as the document class(posted below), which gives me the following errors:
1046: Type was not found or was not a compile-time constant:TextField.
1180: Call to a possibly undefined method TextField.
So im trying to gain access to flash vars but i kept getting this error: Line 27 1180: Call to a possibly undefined method LoaderInfo.
I have tried putting the below code in and outside of my class but it seems from what i have gathered that it thinks 'LoaderInfo' is another function which it is not.
[Code]...
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.
import fl.motion.AnimatorFactory;
import fl.motion.MotionBase;
import fl.motion.Motion;
import flash.filters.*;
[Code].....
I've tried a few places for it, both with the animFactory_Enemy_3 variable and the motion_Enemy_3 variable - getting the same error both times.
I'm very very new on ActionScript 3.0 development for Blackberry Playbook.
I'm working with Double Sided 3D Plane in FP10 and I'm having troubles with this code:
package
{
import flash.display.Sprite;
import flash.events.Event;
[Code]....
I try to call a method kill(); (in function takeDamage()) which is in the same class, yet it won't find it.
package classes.ship
{
imports ...[code].....
Has it to do with var stageReff:Stage = this.stage as Stage; ?
I get this error message a lot and I normally know how to resolve them. However, not this one! I call a function from within a class function (and the called function is within the class .as file.) My question is: does Actionscript allow you to call a function within a function cuz it sure appears not!My code: looks like this
ActionScript Code:
package asdata{
//<import list suppressed >
[code]......
When I use the classpaths to my packages and use a empty package name it works..
classpath: .comcc
.fla
Code:
var scene:Mainclass = new Mainclass(this);
addChild(scene);
Mainclass
Code:
package{
// imports
public class Mainclass extends Sprite{
// vars
public function Mainclass(scope){
[Code] .....
I tried to put a classpath to reflect my /fla location, still no success.