ActionScript 3.0 :: Call A Movieclip Named Movie2 Using The "addChild"?

Apr 13, 2011

In my main timeline I have a variable "tipos = 5" for example.I want to call a movieclip named movie2 using the "addChild". The movie loads without a problem.My problem is that in my "movie2" I have to access my variable "tipos ", but I can't access it...The code "trace(tipos)" on my "movie2" returns an error.

View 4 Replies


Similar Posts:


ActionScript 1/2 :: Class Extends MovieClip But Can't Call 'addChild'

Sep 1, 2009

I'm working on a Flash Lite 3.0 application using AS2 and I've created a class that extends MovieClip. The problem is that I'd like to dynamically add Child Movieclips using the addChild method... but it doesn't work, it gives me the following compiler error: "There is no method with the name 'addChild'". But I can call other MovieClip specific methods such as this.getNextHighestDepth()
 
heres a reduced version of my class: 
 
class com.sck.DragList extends MovieClip {
//Declarations
private var placeHolder:MovieClip;
private var listMask:MovieClip;

[Code]......

View 3 Replies

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

ActionScript 3.0 :: Box2d Addchild - 41061: Call To A Possibly Undefined Method AddChild Through A Reference With Static Type Class

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

Flash :: Address A Named Instance Of A Movieclip From The Class File Of The Movieclip?

Jun 1, 2011

I have a movieclip instance named 'placeholder' on the canvas, and I want to change the alpha of the named movieclip from it's class without effecting the alpha of all the movieclips of the same type. How would I specifically target the named movieclip instance that is on the canvas?

View 3 Replies

ActionScript 3.0 :: Accessing A Named Movieclip In A Movieclip?

Dec 13, 2009

I have created a new instance of a movieclip and named it in as3.
 
I want to put this in another movieclip. How does this effect the reference because everything seems fine while the dynamic movieclip is just dealing with the stage. As soon as I put it in a movieclip, I get:
 
Error #1009: Cannot access a property or method of a null object reference.  at com::Gallery/instancesOut()
 
Heres part of my code:

for(var i:int = 0; i < 20; i++){ var transition:mcTransition = new mcTransition();
addChild(transition);  transition.name = "transition_mc" + i;  transition.x = i * 100;

I can reference using the string name but if I put the addchild in a movieclip it errors
 
Transition_mc.addChild(varTransition);

View 1 Replies

Actionscript 3 :: Added Into Another MovieClip Container Named As Mc?

Aug 13, 2011

I have created 3 movieClips and I added into another movieClip container named as mc.

for(i = 0;i<3;i++)
{
imgBox = new box();
mc.addChild(imgBox);
imgBox.name = "box" + i;
}

[Code]...

View 1 Replies

ActionScript 3.0 :: Call To Possibly Undefined Method AddChild

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

ActionScript 3.0 :: Getting Call To A Possibly Undefined Method AddChild

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

ActionScript 3.0 :: Call To A Possibly Undefined Method AddChild

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

ActionScript 2.0 :: Named Movieclip Instance Coming Up Undefined?

Sep 12, 2007

I have a named movieclip instance coming up undefined in AS2/CS3. the movieclip is on the stage, and I am having trouble accessing it from actionscript. does anyone have any ideas what might be causing the problem?

View 1 Replies

ActionScript 3.0 :: 1180 - Call To Possibly Undefined Method AddChild

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

ActionScript 3.0 :: DisplayObject And AddChild - Use The Variable OpenType In The Call For The Image??

Nov 24, 2009

I am working on a project where we are making a "wizard" where you answer a series of questions and in the end you are presented with a "parts list" based on your answers.There is also logic which decides which questions you are asked based on how you have answered certain questions so far. The outcome is a list of door control hardware (locks, mounting plates, handles etc. etc.). show a "live image" of the parts list as it builds. For example one of the questions is this: Door Type?

A) Aluminum

B) All Glass

C) Wood

Depending on which you choose I need to show an image of an aluminum, glass or wooden door.Then if the next question is about lock types then your new lock shows up and so on and so forth until you reach the end.The questions all relate to their own variable which are each defined at the beginning of the movie like this:

Code:
var doorType:String = "DT0";

The questions use radio buttons and each question (re)defines it's variable like this

Code:
DT1.addEventListener(MouseEvent.CLICK, doorTypeHandler);[code]....

Now the tricky part (for me at least) is figuring how in the world to use this in conjunction with the questions (more accurately, the variables they define) to produce this live image.Another thing to add complication to this whole mess is that there are basically two entire sets of images. Single doors or Double doors, they both have (nearly) all the same hardware but they are two different sets of images. They are differentiated by the ot1 or ot2 in front of the class name. The variable openType defines OT1 or OT2 in a previous question. I would like to be able to use the variable openType in the call for the image

Code:
//This is how I tested it
currImage = new ot2_wood_exit();

//I would like to use openType instead of hard coding ot1 or ot2

currImage = new openType_wood_exit(); //I KNOW this is wrong, but I don't know what is right!So that is my basic dilemma. I need to show or hide specific images based on the answers to previously answered questions AND questions currently being answered (live update).

View 3 Replies

ActionScript 3.0 :: 1180: Call To A Possibly Undefined Method AddChild?

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

ActionScript 3.0 :: 1180: Call To A Possibly Undefined Method AddChild

Jul 30, 2011

I get the folowing error in one of my classes and not too sure why?
 
[Code]....

View 5 Replies

Start From A Label In A Scene From Movie2.swf?

Jun 15, 2009

I have 2 SWF (swf1 and swf2). I want to load swf 2 into 1, but getting it start on a label or a particular frame.

I use this to load SWF 2

Code:

on(release){
loadMovie("movie2.swf",0);
}

How do i target it to start from a label in a scene from movie2.swf?

View 1 Replies

ActionScript 3.0 :: Error - 1180: Call To A Possibly Undefined Method AddChild

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

IDE :: 1061: Call To A Possibly Undefined Method AddChild Through A Reference With Static?

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

ActionScript 3.0 :: Access Local SharedObject Set By MOVIE1 By MOVIE2?

Nov 12, 2009

I have a website where under a single domain (and in a single folder on a web server) - two flash movies are stored: MOVIE1.SWF and MOVIE2.SWF Is it possible to access local SharedObject set by MOVIE1 by MOVIE2? What I do:

[code].....

View 3 Replies

ActionScript 3.0 :: When Open Movie2.swf It Will Automatically Load Movie1.swf?

Nov 19, 2010

My first movie is in AS1: movie1.swf is its name and it only contains a button, releasing it, it loads hello_world.swf  in the _root. The code is:
 
btn.onRelease = function(){_root.loadMovie(hello_world.swf)};
 
It works fine if i open the movie alone, a problem comes when I load it from this other movie called movie2.swf (which is in AS3). The load script in this second movie is:
 
var i =new Loader();
i.load(new URLRequest(movie1.swf));
MovieClip(root).addChild(i);
 
when i open movie2.swf it will automatically load movie1.swf, which looks fine, but now its button doesn't work.Maybe it isn't logic to keep the AS1 in the first movie, but I really want to keep it as it is (cause I would have to change dozens of them,) i really want this AS3 and AS1 communication.

View 4 Replies

ActionScript 2.0 :: CS3 Relative Paths - Can't Seem To Make Movie2.swf Communicate With Movie3.swf

Mar 22, 2009

My situation is this I have 4 movies which load each other, meaning: movie1.swf loads movie2.swf which loads movie3.swf which loads movie4.swf movie3.swf communicates with movie2.swf though the _parent path and it works. but i can't seem to make movie2.swf communicate with movie3.swf since movie2 is _parent i assumed movie3 is a _child...but it does not work so my question is what do i replace _child with?

PHP Code: _child.mc.gotoAndStop("subM" + no); ps: would apreciate it if u could tell me a bit about levels ex: _level10/_level0 what do they mean and how can i tell on what level i have something

View 1 Replies

Use A Variable And Then AddChild With A RemoveChild For The Old MovieClip After The New MovieClip Has Loaded

Mar 30, 2009

This is something I'm experimenting with, but haven't seemed to figure out... I have several MovieClips, basically the same, only different colors. As each one plays, I'd like it to "overlap" whichever one is already there. Right now I have each button linked to a gotoAndPlay function, but I don't think that will ever get me what I want. You can see how I have it now here: [URL]

Instead of having the content MovieClip go back to all white when a button is clicked, I'd like the preivious one to remain, and get "covered up" by the new one. You continue to see the old color, and the new color overlaps it. I have a feeling I need to use a variable and then addChild, with a removeChild for the old MovieClip after the new MovieClip has loaded, but I'm not getting any good results yet.

View 1 Replies

ActionScript 3.0 :: Call To Possibly Undefined Method AddChild - Convert A Auto-scrolling TextField Into A Class

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

ActionScript 3.0 :: Error : 1061: Call To A Possibly Undefined Method AddChild Through A Reference With Static Type Class

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

ActionScript 3.0 :: Can't AddChild To Movieclip Inside Movieclip

Jul 13, 2010

my_mediafile.load(new URLRequest("PMP2.jpg"));
//trace ("my_mediafile "+my_mediafile);
trace(mc_pmp.gfx_pmp)
mc_pmp.addChild(my_mediafile);

i have a movie clip(called gfx_pmp) inside of my movieclip (called mc_pmp) and i wanted to add a child to that movieclip gfx_pmp

thought i could use this code

mc_pmp.gfx_pmp.addChild(my_mediafile)

but it doesn't seem to work. when i ran a trace on mc_pmp.gfx_pmp it returned null as a value

trace(mc_pmp.gfx_pmp)
//returns null

i dont see what the issue is here, or why the trace on that is returning null

[object mc_pmp_43]
1st trace gfx_pmp [object MovieClip]
2ndtrace gfx_pmp [object MovieClip]

[Code]....

View 2 Replies

ActionScript 1/2 :: Dynamic Text Boxes One Named "item" And One Named "ssnumber"?

Jan 17, 2011

here is my new code that works for PART of my movie. i have two dynamic text boxes, one named "item" and one named "ssnumber" ssnumberNode works fine but itemNode does not. i bolded the parts that i think are relevant to the problems

[Code]...

View 3 Replies

ActionScript 2.0 :: Make The MovieClip Named "fish" Go To A Randomly Generated Spot?

Apr 6, 2004

I am trying to make the movieClip named "fish" go to a randomly generated spot. I tried using the tutorial, but I didn't understand the math, so I tried it with my own code. I'm not as much interested in getting this to work as I am knowing why it doesn't work.

PHP Code:

fish.onLoad = function() {
generatePoint();
}
fish.onEnterFrame = function() {

[Code].....

View 3 Replies

ActionScript 3.0 :: AddChild MovieClip Within MovieClip

Dec 21, 2010

On my stage I have a movie clip called 'm1'. I also have a variable 'i' which is equal to 1. if I load in a bitmap (called 'bmp') and then use: this["m"+i].addChild(bmp) it attaches the bitmap to the movie clip - no problem. However, if I have a second movie clip WITHIN 'm1' (let's say this second movie clip is called 'mm1') - I can't figure out how to dynamically attach the bitmap to the second movie clip. this["m"+i].this["mm"+1].addChild(bmp) doesn't work....

View 1 Replies

ActionScript 3.0 :: AddChild To MovieClip And Bitmap

Oct 10, 2009

I am having ongoing issue with using addChild(). Everything else works. The code below now loads all thirty five images and the addChild command is used directly on the Bitmap in initHandler in the ButtonClass.as excerpt below. Now I commented out the line that I was going to use to add these Bitmaps as children of the MovieClip in placeThumbnail function in the FLA. So I believe the only problem I have left is finding a way to get the Bitmaps to be children of the correct MC //This code excerpt is from ButtonClass.as

public function imgLoad(buttonMC:MovieClip) {
imgLoader = new Loader();
imgLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, finished_loading);
imgLoader.contentLoaderInfo.addEventListener(Event.INIT, initHandler);
var link=buttonMC.entry_thumbnail;
[Code] .....

View 1 Replies

ActionScript 3.0 :: AddChild To A MovieClip Using Timer?

Apr 21, 2011

i've been trying to add a child to a movieclip that already exists on the stage using a timer event. i can't get this to work. i have been able to add a child through other events such as mouse down but this one wont work. here is the code for the timer.
 
var person:MovieClip;
var peopleFrequency:uint = 400;
var peopleTimer:Timer =new Timer(peopleFrequency);

[Code].....

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved