ActionScript 3.0 :: AddChild MouseClick - Add The Image In The Class And Not After?
Oct 30, 2010
If I want to have a mouseEvent and add an image to a sprite I need to add the image in the class and not after ? See where I have used addChild?
[Code]...
View 2 Replies
Similar Posts:
Oct 30, 2010
If I want to have a mouseEvent and add an image to a sprite I need to add the image in the class and not after? See where I have used addChild?
[Code]....
View 1 Replies
Dec 5, 2009
trouble to slide a mc that loads external image through a addChild function.How do I change the code in order to slide the mc that contains the new mc addChild that the loader has created?Heres my code, I have been trying to crack this for days and I couldn't seem to solve it.trying to convert myself from AS2 to AS3
Code:
var speed:Number=4;
var imageLoader:Loader;
[code].....
View 1 Replies
Jul 26, 2011
Gallery in DataGroup, How can i Call selected image(MouseClick Image) this is my Sample code
<fx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
[code].....
View 1 Replies
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
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
Aug 11, 2010
I'm was following a tutorial where you can load an unload a image or swf in a container through clicking on a button (ofcourse). but now i'm trying to add a 2nd button which loads another image or swf in the SAME container. This is the code:
[Code]...
View 2 Replies
Dec 30, 2009
I have an FLA in which there are a number of MovieClips in its library. I also have a document class for this FLA, which I will refer to as Body.as from here out.From Body.as, I call other classes designed to put stuff together and allow for organization due to large amount of MCs I have to use in the FLA. For reference, these classes are called as such: Head.as, Chest.as, Arms.as, etc etc.Now, where Body.as is the document class, and is therefore functioning to operate all areas in the FLA, I wanted to use these additional class files to be used to manage anything related to them, including any MCs I have. I'll use Head.as for explaining. To that end, I have four MCs, each named as follows:hat1hat2hathat4s part of trying to organize it all, I want to be able to call a singular function in Head.as that will retrieve these MovieClips and add them to the stage (Or, as I hope to do once I get a bit further in, add them to a larger MC that will then be added to the stage).
View 9 Replies
Jun 3, 2010
i want to add to stage a movieclip in another class not the .as file as the same name of .fla file how can i get this.When i run same code in main.as i get the result but in another class it runs but no result.
View 2 Replies
Nov 28, 2011
I've got 2 classes:
Main.as
ActionScript Code:
package {
import flash.display.Bitmap;
import flash.display.Sprite;
[Code]....
When I do this there are no errors, but the 'addChild' function is not working. if I put the addChild function in the Main.as then everything works just fine. So my question is: How can I Let the addChild function work from another class then the main class.
View 2 Replies
Jun 9, 2010
I may be losing my mind. I am simply trying to add a textfield and addchild to that textfield.
Here is the textfield class
Code:
package {
import flash.display.*;
import flash.text.TextField;
[code]...
Works great until I try to addChild to that textField from either Frame 1 or the class itself. I can trace it perfectly, trace the class, trace the functions, trace everything in the functions but I can not addChild.
View 4 Replies
Sep 25, 2009
I have this class called AD. Its attached to my stage. AD then calls a class file called setupBoxes.
setupBoxes sets up a box using box2d (which has nothing to do with my question so dont stop reading here), attaches a movieclip to it, and attempts to "addChild". No errors, but no results.The thing is, in setupBoxes i even tryed using this code which i found on another forum.
PHP Code:
improt AD;
//creation of class and brakets and things.
public static var ad:AD;
//long box2d and setup process and more brackets...
ad.addChild(container);
View 2 Replies
May 13, 2011
I am trying to pull a funtion that adds a child to a container. This function gets pulled in another class. All the traces do work by the child doesn't show.
pulling the function from StickerBook_Class
---------------------------------------------------------------------- -----
public static var stickBook_Class:StickerBook_Class = new StickerBook_Class ;
[code].....
View 2 Replies
Apr 5, 2010
For a school assignment I'm making a panorama version of my own room using a cube with 6 pictures in it. It created the panorama, it works great.But now I want to add clickable objects in it. One of the requirements is that my code is OOP focused. So that's what I am trying right now.
Currently I got two classes
- Main.as (Here i make the panorama cube as the room)
- photoWall.as (Here I want to create my first clickable object)
Now my problem is: I want to addChild a clickable object from photoWall.as to my panorama room. But he doesn't show it? I think it has something to do with the scenes. I use a new scene in Main.as and in photoWall.as. No errors or warnings are reported This is the piece in photoWall.as were I want to addChild my object (photoList):
private function portret():void
{
//defining my material for the clickable portret
var material : BitmapFileMaterial = new BitmapFileMaterial('images/room.jpg');
[code]....
View 2 Replies
May 31, 2011
I am trying to add an object to my main stage via the addChild() method. Normally, when working within the FLA itself, using addChild(myObject) works just fine. However, it does not work within an external AS class.
All of the other tutorials I have found showed me how to do something like this, which is not what I need:
var myMovieClip:MovieClip = new MovieClip();
myMovieClip.addChild(myObject); // Works great, but not what I need
how to add an object to my main stage via an external AS class.
View 2 Replies
Nov 28, 2010
how to add an image under another one called with addChild?
View 1 Replies
May 29, 2009
I need to reload the same JPG about every second for an indefinite time. Problem is that that right now with addchild it adds the JPG on top of the old one eventually running out of memory from adding so many JPG's Is there a way to specify with addchild() to replace the old one?
[Code]....
View 6 Replies
Sep 23, 2009
lets say i have document class 1 that loads class a and class b to the stage. I have a button in class a, that when clicked it should addChild to the mc governed by class b.... is this possible?
View 4 Replies
Jan 25, 2010
i only want to make an addChild on the "root" ( or stage? as3 is really different from 2, im really confused)
the MAIN class:
ActionScript Code:
package com.website
{
import flash.display.*;
[Code].....
View 9 Replies
Aug 18, 2010
I have an array of a custom class. The class includes 3 movieclips that all share the same position. I have 5 items in the array, and in the document constructor I fill them as such:
ActionScript Code:
glassArray[0] = new glasses(spot, beam1, glasses2, "index/nav/aboutus", new Point(156, 400));(different string and point for each of the 5 items)
Here's the glasses constructor:
ActionScript Code:
public class glasses extends MovieClip{ //I am the Constructor.
public var spot:MovieClip;
public var beam:MovieClip;
public var glass:MovieClip;
protected var target:String;
[Code] .....
It then goes on to fill each of those mclips with properties based on the point received. How to addchild from the class, I've got a simple for loop in the document constructor that adds them all in. Everything works, except what I'm seeing is that as each item in the array is added in, it overwrites the previous items' properties. In effect, I can create 5 items and give them each a different position, but when I go to addChild I see that all of them have taken on the position of the 5th one.!
View 2 Replies
Apr 10, 2010
I can't do many simple things in AS3 that take 1 second to do in AS2,
All I want to do is attach a movieclip to the stage via a .as file that ISNT the document class.
So for examples sake lets say I have Main.swf - Main swf file with a movieclip called "PreloaderGUI". Main.as - The document class, this loads Preloader.as. Preloader.as - This preloads the movie and attaches PreloaderGUI.
View 8 Replies
Feb 15, 2010
I have an .fla file with 1 image in the library and 1 .as file.I have linked the image up with the Class name of libraryImages and Base class is flash.display.BitmapData.This is my AS:
package {
import flash.display.Bitmap;
import flash.display.BitmapData;
[code].....
View 1 Replies
Apr 19, 2011
I had a working normal time line code:
[Code]....
which works fine and loaded the image, however when I make a class file out of it it never load the image. The trace in the class did indicate that it was running >start drawing If anyone knows why,
[Code]....
View 4 Replies
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
Feb 16, 2011
I have a main package that adds the background image to the project, from here on im trying to have seperate classes that add objects to the background as a parent and control these objects.my code in the main package:
package
{
import Dinos_Control;
[code]....
View 3 Replies
Feb 6, 2012
I have defined some sprites in a class .as file and I want to put them in the screen. How can I do this?
View 2 Replies
Oct 27, 2009
What I describe here is not correct. My full code had some other things in it that was the reason I couln't see mc2. The code described under is actually working!
I have custom class (MyContainer) that extends Sprite. Then:
Code:
var mycon:MyContainer = new MyContainer();
var mc1:Sprite = new Ball(); // Ball is a sprite in my library
var mc2:Sprite = new Ball();
[Code]....
it works, but I dont want that, as MyContainer has custom variables and functions I use. A simple: if (mycon is DisplayObjectContainer) evaluates to true.
View 0 Replies
Feb 1, 2010
I got a background asset loaded then I want to add a textField above that asset. How do I do this. It sets behind. And I can�t figure out how to override the IDisplay class.
View 0 Replies
Feb 6, 2009
I'm have trouble attaching graphics to the stage from a class. I can do it on the timeline but the code doesn't work in a package.[code]this doesn't seem to work even if I import the picture in the package.[code]
View 1 Replies
Feb 15, 2009
I believe this should be a very simple fix, but I cannot for the life of me get this working, and i've been playing with it all day. Basically I am trying to start working with classes, I want to attach a movieclip to a flash movie, from my class [its for a card game style thing]. But when I attach a movie clip, it does not appear on the screen,. It exists, I can trace its .x position etc.
Code:
Select allpackage arrayTrial{
import flash.display.Sprite;
import flash.events.Event;
import flash.display.MovieClip;
public class Deck extends MovieClip{
private var totalCards = -1;
[Code] .....
View 1 Replies