ActionScript 3.0 :: Depth Management Of Instances Created At Runtime?

Dec 16, 2009

im develloping an application for  create a layout of advertising newspaper. the user can set the number of pages, and create rectangles represanting the adverts, then drag them and place them into the the representation of the page.the display list is as follow:  on the main stage there is inputs textfields and a button that create the pages according to the number that the user typed.Then instances of the pages are created (MC Page in the lybrary exported for AS as Page and i have a class Page as well). Inside this clip Page i have my tools for create the rectangles and drag and place.....As well as the instances of my pages are created, button(1 for each Page)  are also created. NOTE that Page and button are in the main stage My probleme is that i want my button to change the  depth of is related page for it can be on top or alpha at 100% or the visibilty to true, but my button doesnt find the instance name of the pages at the export because they are not yet created.

View 9 Replies


Similar Posts:


Easy Depth Management In Flash?

Mar 2, 2009

I've recently created a game in which the logic and programming all runs perfectly, however the graphics are lackluster. I'm currently having a hard time managing the depth of movieclips on the screen.Basically the game is tile based and each frame of the movieclip holds a different type of tile. All the tiles are 50x50 with the exception of one type of tile which is 60x60 and therein needs to overlap the tiles around it which are 50x50.In AS2 I could of set the depth manually, however I'm told (as is this is my first time dealing with depth in AS3) that I cannot do this anymore. Is there any suggestions on how I can make sure that a tile of one type is automatically set beneath tiles of another type - I've thought about simply coding a function to check this but it somehow seems inefficient (considering larger maps will have a lot of tiles, meaning hundreds of movieclips attached to the stage, each movieclip with multiple frames).

View 2 Replies

ActionScript 3.0 :: Movieclip Depth Management?

Apr 24, 2010

I started with some AS2 pageflip code that I've been modifying because I needed the code in AS3, and I wanted to make some changes to it. At anyrate, I'm having a problem with the depth of two movieclips created. The code first creates a page using the makePage function, and then creates a shade for that page (makeShade function).When running the code, the page appears on top of the shade. When using getChildIndex, the page's index = 11, and the shade's index = 14.

The complete code is super long so I've attached the code that has the shade and page below:

//create left-aligned page-sized solid fill
function makePage(targ, xQuadrant) {
//trace ("in make page");

[code]...

View 1 Replies

ActionScript 3.0 :: Loader Instances And Memory Management?

Aug 18, 2009

Hi guys, I'm wondering whether any of you have any opinions on whether you instantiate a Loader into an instance variable, or whether you declare a local variable to hold the Loader object.

I'm coming at this from a memory management / garbage collection perspective.

I only need the Loader object to load the file and register the event listeners. So I don't really want an object-wide instance variable to hold this loader object (which is what Adobe does in most of their examples), since I can always access the loader.data through the event's target property.

[Code]...

View 2 Replies

Actionscript 3.0 :: Change Cube Depth At Runtime?

Apr 15, 2009

I have a cube with depth = 0 that acts as a double sided plane.[code]...

We can't use depth as a property of the cube, so how can I change the depth of the cube?

View 1 Replies

ActionScript 3.0 :: Z-Depth - Sort MCs On Stage That Belong To Different Instances Of Different Objects

Sep 14, 2010

I'm trying to sort MCs on stage that belong to different instances of different objects.

[Code]...

is there a simple way to use the Depth Management methods to control their sorting order? Right now, all I know how to do is place objectTypeB either in front of or behind all members of objectTypeA.

View 3 Replies

Flex :: Give A Depth To An Object Created From Graphics?

Apr 18, 2011

I am drawing some lines in my program using

graphics.lineTo(xx, yy);

The program has a background image over which these lines are drawn.The problem which I am facing is that the image overshadows the lines and the lines are not visible to the user.Since these lines do not have an id, I am not sure as to how I can assign a depth to them?

View 2 Replies

ActionScript 2.0 :: Depth With Dynamically Created Textboxes And Ungrouped / Non-symbol Objects

Aug 10, 2004

im building a full as anything text-typing-component... easily modified and adapted etc...one problem however... i came across a depth issue in testing.... its a little peculiar so you will have to bear with me... i have 2 layers, called typer layer and plain layer... on the plain layer i have drawn out a shape... like a circle for instance.... if plain layer is on top of typer layer everything works fine. if plain layer is below typer layer the typer does not type.... it doesnt even show up....

[Code]....

View 12 Replies

ActionScript 3.0 :: Creating Instances At Runtime?

Sep 19, 2009

Been struggling with the basics of creating instances at runtime. I needed to implement an XML video player and even though the client has supplied a component that they liked and it works fine, i cant turn it off as im not sure how the thing works. Basically the timeline hits a keyframe and stops. It runs the code to make the player popup but once the user has exited, the player stays on.If the function creates an instance for flv playback... how do i tell it to stop?

function below
function makePlayer ():void {
my_player = new FLVPlayback();[code].........

View 1 Replies

Reference Instances Created By A Loop Elsewhere?

Jan 20, 2010

[code]My code will:

- loop through the Grid array and place each tile on the stage

- assign RedBall a random Grid coordinate and places it on the stage at that coordinate

I want to be able to click RedBall, which will create a border around the tile beneath RedBall, and create borders around the tiles above, below, to the left and to the right. BUT, I don't want to reference the tiles by their distance in pixels from RedBall or from each other; I want to reference the tiles by their coordinates in the Grid array. So I want to:

- get the coordinates of RedBall

- use those same coodinates to reference the tile at the same coordinates in the Grid array

- use the tile's coordinates to reference the tiles above/below/left/right

- apply a border to all these tiles

What's the best way to reference an instance of a tile? Should I apply a name to each instance as it's created in the loop? like myTile.name = "tile"+i+"_"+j; ? If so, how do you reference that instance later? Just tile1_3 ? Do you have to prepend it with root, or stage, or the class it was originally created in? Do you have to use getChildByName? OR, can you still reference it later without having given it a name?

View 1 Replies

ActionScript 3.0 :: Created A Number Of Instances?

Dec 9, 2011

In my main class (BaseController.as) I created a number of instances.
 
public class BaseController extends MovieClip implements IMXP {
public static const DEBUG_MODE:Boolean = false;
// APP APPLICATION SPECIFIC VARIABLES
public var mapLoader : MovieClip;

[Code]...

View 1 Replies

ActionScript 1/2 :: Removing Movieclips Created At Runtime?

Mar 9, 2009

I'm trying to remove movieclips created at run time using "createEmptyMovieClip" but I'm having a problem calling the "removeMovieClip" function. The difficulty seems to be that the string that I assign as the instance name of the new movie clip doesn't actually refer to the created clip when I try to call"removeMovieClip".

So the "removeMovieClip" function doesn't work if the target name is pulled from the array. My guess is that this has something to do with the values of the array being strings...and it does when I manually type Apple.removeMovieClip(); in because Apple is the movieclip object name. How do call the "removeMovieClip"function using a var as the target?

View 3 Replies

Flex :: Can Add Scrollbars To A SkinnableContainer Created Runtime?

May 18, 2011

I created a SkinnableContainer runtime because I want to set some style properties to it, then based on some external data I need to create a new SkinnableContainer and add it as children of the first one. This children height can be greater than the parent container.How can I create a SkinnableContainer runtime with some scrollbars?I read in the documentation that I need] to create a new Skin. [code

View 1 Replies

ActionScript 3.0 :: Clone A DisplayObject Created At Runtime?

May 14, 2010

I do not know how to copy a DisplayObject can anyone can help me on this one? I've downloaded an image from a website at runtime and putting it into a DisplayObject and now I'd like to create a completely separate copy of it so I do not have to make another request to download it again.

View 3 Replies

ActionScript 2.0 :: Referencing Instances Created With AttachMovie?

Jun 8, 2007

I have a situation where I create many instances of an MC, one for each node in an XML file (using a for loop), using attachMovie.

Code:
var photo_mc = _root.center_mc.photosLevel1_mc.attachMovie("photoFrame_mc", photoName, itemCount);

[code].....

View 7 Replies

ActionScript 3.0 :: Reference Instances Created By A Loop Elsewhere?

Jan 20, 2010

My code will:

- loop through the Grid array and place each tile on the stage
- assign RedBall a random Grid coordinate and places it on the stage at that coordinate

I want to be able to click RedBall, which will create a border around the tile beneath RedBall, and create borders around the tiles above, below, to the left and to the right. BUT, I don't want to reference the tiles by their distance in pixels from RedBall or from each other; I want to reference the tiles by their coordinates in the Grid array.So I want to:

- get the coordinates of RedBall
- use those same coodinates to reference the tile at the same coordinates in the Grid array
- use the tile's coordinates to reference the tiles above/below/left/right
- apply a border to all these tiles

What's the best way to reference an instance of a tile? Should I apply a name to each instance as it's created in the loop? like myTile.name = "tile"+i+"_"+j; ? If so, how do you reference that instance later? Just tile1_3 ? Do you have to prepend it with root, or stage, or the class it was originally created in? Do you have to use getChildByName? OR, can you still reference it later without having given it a name?

View 3 Replies

ActionScript 3.0 :: Using And Referring To Dynamically Created Instances?

May 26, 2010

I'm creating a DDR style game. The 'moving graphics' are being randomly and dynamically created with the default instance name (instance28, instance 30...) I want to be able to refer to these different elements according to another movie clip I press (in this case, they look like piano keys).

So, if a 'C' moving graphic is created, I want the C movie_clip with a listener attached to check the 'C' moving graphic.

[Code]...

View 2 Replies

ActionScript 3.0 :: Add Textfields Created At Runtime Into Flash Combobox?

Aug 26, 2009

How can I add textfields created at runtime into flash combobox?

View 1 Replies

Flash :: Resize The Drawings Objects Created In Runtime?

Jan 21, 2012

I am new in flash so this question can sound stupid

I am about to create my first drawing in the adobe flash of some creature.

The problem is CAN i resize it when the flash is running (in runtime) by the end user.

Example: I want to increase the height of the creature.

View 1 Replies

ActionScript 3.0 :: Getting Dynamically Created MovieClip Names During Runtime?

Nov 8, 2010

Is there a way to obtain a reference name of each item on the stage. A reference name that can be then used to manipulate the object? (and how would one do that if successful in obtaining the name?)

As an example that is not working for me, if I drag to stage two movie clips and dynamically include 5 additional movie clips at runtime, this [code]...

View 2 Replies

ActionScript 3.0 :: Accessing Movieclip Properties Which Are Created During Runtime?

Mar 9, 2011

how to access the properties of the movieclips which are created during runtime.

Ex:
var dotCount:uint = 0;
for(var i:uint = 0; i<=10;i++)
{
var circle:MovieClip = new MovieClip();

[Code]....

How can I access a property (say .alpha or any other property) of "circle6"??

View 2 Replies

ActionScript 3.0 :: Animating Instances Of An Object Created By A For Loop?

Dec 25, 2009

I'v been toying with this for a few weeks now and I'm trying to find the best way to animate several instances of an object created by a for loop thru an ENTER_FRAME function.When the function runs only 1 of the 3 instances that were created animates.

var balloonArray:Array = new Array();var balloon: hotAirBalloon;var xVel: Number = -3;var yVel: Number = -4;
addEventListener(Event.ENTER_FRAME, startBalloons)

[code]....

View 9 Replies

ActionScript 3.0 :: Make Instances Of A Dynamically Created MovieClip?

Jul 17, 2009

How could you do something like this? [code]...

View 5 Replies

ActionScript 3.0 :: Calling Button Instances Created With XML Data?

Nov 29, 2009

this is my first post on this forum so please take it easy on me as I am sure that this will be a simple answer for most of you out there. Here is what I am working with: I have dynamically added 4 buttons to the stage using XML data and a loop to place as many buttons as will allow per the data. Once the game begins, a MovieClip that I have also added to the stage will jump randomly from frames 1-16 and stop using a stage event listener. I need to have event-listeners on each of the buttons I have created using the XML data to check to see if the user has selected a correct answer. I had intended on using a function that would check to see which button was clicked and check to see what frame the movieClip was on when that button was clicked and judge right or wrong that way.

[Code]...

View 4 Replies

Actionscript 3 :: Embed Fonts At Runtime To Use For Existing Dynamic Textfield Instances In SWFs?

May 25, 2011

I'm trying to embed fonts at runtime in actionscript and it somewhat works. I can embed fonts by either using the embed tag or by loading a font library asset with a linkage name and use it with a new TextField. However, a textfield that exists on a movie clip already does not have the embedded font and is missing characters.

A quick example in code (textInstance exists on the movieclip):
var embeddedFonts = Font.enumerateFonts(); //Shows embedded font
var textFormat:TextFormat = textInstance.getTextFormat();
textInstance.text = "Don't be lazy"; //missing characters

[Code].....

I want to embed the font at runtime and I'm loading multiple SWFs and I don't want to embed the font in each SWF.

View 2 Replies

ActionScript 3.0 :: Embed Fonts In Dynamic TLF Textfied Which Is Created During Runtime?

Jul 15, 2011

I have two TLF textfileds in my application. The first TLF textfield is on the stage and the second one is created dynamically during runtime. Now I am able to embed the fonts in the first TLF textfield by using "use device fonts" since it is on stage. The flash player the rendering the data absolutely fine. I want to get the same look and feel for the second TLF textfield which is created dynamically during runtime. I tried so many ways.

Here is the code I am trying.
 
[Code]....

View 7 Replies

Flash - What's The Definition Name For Fonts Loaded At Runtime Created With Fontswf

Apr 11, 2011

I ran into the 'fontswf' utility to embed TTF fonts into SWF and I am struggling to load them at runtime from my app. All the examples I find online refer to loading the font via [Embed] but I am actually loading them with a flash.display.Loader and from what I gather, once the Loader.contentLoaderInfo fires an Event.INIT I need to register the font, like so:

public function handleLoaderComplete( event:Event ):void {
var FontClass:Class = event.target.applicationDomain.getDefinition( fontName );
Font.registerFont( FontClass );
}

The problem is I don't know what to pass in as fontName. I am generating my SWF through:

$ fontswf -a belshaw -o belshaw.swf belshaw.ttf

But when I try to call getDefinition( 'belshaw' ), I get an error saying 'Variable belshaw is not defined'. Any suggestions on how to accomplish this?The alternative is to generate my on SWF files through templating an .as file and compiling them, but I would rather use a built in tool like fontswf if it's already there.

View 2 Replies

Flex :: Dynamically Bind Properties Of Components Created At Runtime?

May 27, 2007

I need to dynamically bind properties of components created at runtime. In this particular case please assume I need to use bindProperty. I don't quite understand why the following simplistic test is failing (see code). When I click the button, the label text does not change.

I realize that there are simpler ways to go about this particular example using traditional non-dynamic binding, but I need to understand it in terms of using bindProperty.

<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:ns1="Tools.*" minWidth="684" minHeight="484" xmlns:ns2="*" creationComplete="Init();">

[code]....

View 1 Replies

ActionScript 2.0 :: Multiple ColorTransform Object Instances Not Created In Loop?

Dec 17, 2006

I thought this would be simple but for some reason I'm having all kinds of problems. Why won't the for loop create a new c instance each time the loop increments, like it does for sHolder and s? ...And, assuming it is possible to make it do this, how can each instance be given an identifier that can be accessed dynamically, like sHolder and s in the traceSomething function?

Code:
package {
import flash.display.Sprite;
import flash.geom.ColorTransform;

[Code]....

View 12 Replies

ActionScript 2.0 :: Apply Actions To An Attached/created Movie Clip At Runtime?

Sep 12, 2004

apply actions to an attached/created movie clip at runtime? I.E. You use attachMovieClip to attach a clip, and then you add a startDrag/stopDrag system to it dynamically.

View 3 Replies







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