ActionScript 3.0 :: AddChild From A Class - Get The Error "1180 : Call To A Possibly Undefined Method AddChild?
Jun 15, 2011
I'm trying to have a class file which can add objects to the stage via addChild; however, when I call addChild from within the class file, I get the error "1180: Call to a possibly undefined method addChild." I've tried importing flash.display.* and that doesn't fix the problem. Does the class file have to extend Sprite or MovieClip to be able to add objects to the stage?
View 8 Replies
Similar Posts:
May 19, 2011
I'm trying to get an image to appear on a screen through a class, and I keep getting:
Quote:
Location: Stuff.as, line 21
Description: 1180: Call to a possibly undefined method addChild.
Source: addChild(sp);
I've tried to fix it on my own, but it isn't working.my code for the files is below.
Stuff.as
ActionScript Code:
package newRPG_Class {
import flash.display.Sprite;
[code]...
View 4 Replies
Aug 3, 2010
This ActionScript Code:
package {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.ui.*;
[Code] .....
Generates this error:
Code:
C:UsersHaavardDocumentsFlashTurret 1.75 ZombieMaker.as, Line 22
1180: Call to a possibly undefined method addChild.
View 3 Replies
Jan 27, 2011
I'm making a bonehead error but I 've been designing this since last night and I just started coding it, so I'm not at my sharpest ATM.
Code so far;
ActionScript Code:
package
{
import flash.display.*;
[Code]....
And, yes, automatically declare stage instances is checked under as3 settings.
View 4 Replies
Jul 30, 2011
I get the folowing error in one of my classes and not too sure why?
[Code]....
View 5 Replies
Jan 16, 2012
I have downloaded Box2d ([URL]) and created a project that looks like this: [URL]. catalyst is the green cube and it has the base class "shapes.box", it is inside "world" which has the base class "wck.World". What i want to do is to add another "catalyst" from the library inside "world" when i click on add_btn. I tried to accomplish this by this code:
[Code]...
Symbol 'buttons', Layer 'Actions', Frame 1, Line 41061: Call to a possibly undefined method addChild through a reference with static type Class.
View 9 Replies
Jul 13, 2010
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);
View 4 Replies
Nov 28, 2010
Im getting this error: 1180C: as3_scrollbarAS3 ScrollbarsrcclassesMain.as, Line 1 1180: Call to a possibly undefined method addFrameScript. the actionscript in my .fla timeline is: _scrollBar = new FullScreenScrollBar(_content, 0x222222, 0xff4400, 0x05b59a, 0xffffff, 15, 15, 4, true); addChild(_scrollBar)
[Code]....
View 5 Replies
Jan 18, 2011
I'm new to oop and I'm trying to convert a auto scrolling TextField into a class. I guess it has something to do with there not being a stage when the class is instantiated but I'm not sure how to get around it. my code:
[Code]...
View 3 Replies
Nov 4, 2009
when i use addChild method in my class I got this message . Why it shows error "Call to possibly undefined method addChild"
View 3 Replies
Sep 30, 2010
In 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]...
View 7 Replies
Mar 3, 2011
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 Replies
Nov 19, 2010
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 Replies
Jan 3, 2012
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; ?
View 2 Replies
Feb 4, 2008
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]......
View 9 Replies
Aug 11, 2009
I am a newbee and just starting to learn about AS3. Copied some ideas and tried to paint a single particle on the stage for starters. No success! I get this...1061: Call to a possibly undefined method addChild through a reference with static type flash.displayisplayObject.In an "Particle.as" file I have this code...
package
{
import flash.display.*;
[code].....
View 2 Replies
Sep 25, 2009
why 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.
View 4 Replies
Jun 7, 2009
When i try to compile my file it show the following error.
[Code].....
View 12 Replies
Jan 26, 2010
i have tried to create a sakura petal falling using flash AS3 along with flash my codes always get error message "1180: Call to a possibly undefined method Sakura1." line 16, could anyone tell me why is that happen?
[Code]...
View 6 Replies
Sep 18, 2010
I am trying to script an external text loader in CS4 and am getting the same error message every time. I have loaded an external font into my library and renamed it font2. the error is on Frame 1, Line 2 var myFont= newfont2Here is the script
var myFont= new font2 ()
myTextField_txt.embedFonts=true;
myTextField_txt.antiAliasType=AnitAliasType.ADVANCED;
[code].....
View 1 Replies
Jun 25, 2010
package {
import flash.display.Sprite;
import flash.utils.*;
public class SetTimeoutExample extends Sprite {
[code]....
i get this 1180 error in as3.how can i solve this?i google it but i can't apply the solutions to my my code.
View 4 Replies
Oct 13, 2009
var class:Class = getDefinitionByName("Box") as Class;
var box:MovieClip = new class()
*Box is a class that exists inside my library (A movieclip that is exported for actionscript) I have this code in two places: My document class and some other random class. It works in the document class. It fails to work in the other class (I get the error in the title) Both classes extend MovieClip (if that makes any difference) So what's going on here? Do you know the problem with what I'm doing?
View 2 Replies
Apr 15, 2010
Can someone help me with this error: 1180: Call to a possibly undefined method questionNum.
occurring on this line
[Code]...
View 4 Replies
Apr 20, 2009
I new to AS3 and Flash and have a question about this code. I can't seem to discern how the Menu is generated. The stage has only 3 object, 3 buttons the menu return buttons. My copy is based on this exact code but I get this error: 1180: Call to a possibly undefined method menu. var button:MovieClip = new menu(); The working copy of this .fla file somehow generates a MENU with the names Project 1 - drag and drop
[Code]...
View 2 Replies
Jul 19, 2011
I used to work on AS2 to make my animations, buttons and portfolios, but now I needed to use AS3 to make some forms interact with some PHP script. TextInputs and Buttons on COMPONENTS are working and interacting normally with PHP. My PreLoader is working great too. But what should the easiest is not working: MY SIMPLE BUTTONS! It used to be so easy in AS1 and 2, but now on AS3 it's not working. I am putting all my action and codes in a ACTIONS FRAME in the top of my animation, but it is not working! I have my Preloader on my frame 1 working, calling my animation on frame 2. The code is here (it's working):
[Code].....
View 4 Replies
Mar 1, 2010
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].....
View 1 Replies
Jun 18, 2010
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.
View 4 Replies
Jun 30, 2010
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] .....
View 4 Replies
Dec 9, 2008
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.
View 2 Replies
Apr 15, 2012
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]...
View 3 Replies