Professional :: One Parent.swf, Many Children, Lots Of Shared Assets?

Apr 16, 2011

I'm doing an AS2 project with a parent.swf that loads many child_##.swf's. they each use identical buttons and other library assets.tried using Shared Library concept two different ways:

1 - created library.swf and used assets from it for child swf's ... no problem when child is played by itself, but when parent loads the child's, shared assets do not work,

2- established parent.swf as the 'library', and followed the common steps of Shared Library setup, but shared assets did not work. of course, using class files works, but still I need a central place for the graphics ( I'm avoiding having my classes create graphics via draw methods ).

View 1 Replies


Similar Posts:


ActionScript 2.0 :: Shared Assets And Linkage?

Aug 17, 2007

My company is working on an existing project done is AS2. Since this is a skinnable template, they would like to be able to have a choice of approx 20 fonts. Of course this would take a 1/2 hour to compile and be a 5mb download, so we need to load the fonts in dynamically.

So we have 20 compiled fonts, "arial.swf", "verdana.swf", etc And we have our root, "main.swf" At runtime, main.swf needs to load one of the font swf's and then be able to use that font.Here is the trouble: So far as I can tell, AS2 cannot give you access to the linkage ID of an asset you've loaded (using MovieClipLoader). I can place an individual instance on the stage, but I'd need to load the swf for each instance.

I tried creating a MC with a textfield in it and linked this to a class, but this doesn't work.I also tried to run duplicateMovieClip() on the instance that was loaded, but this doesn't allow you to relocate the clip to the desired location.

View 3 Replies

ActionScript 3.0 :: Shared Library - Loop Through To Get The Assets

Jan 8, 2011

I have a great shared library tutorial BUT I don't like one section. Assets.swf is the shared library with a variable array called availablegraphics on it's timeline where we put in the available assets That is the bit I don't like. Isn't there a better way to loop through to get the assets. Also they use a loop using library.availablegraphics - which I have never seen before and seems a little weird. In conclusion it's great but is there a better post or tutorial on shared library and how to loop through the assets without knowing exactly what or how many there are.

[Code]...

View 4 Replies

ActionScript 3.0 :: Get SWC Assets With Children?

May 18, 2011

How do I publish and import a SWC in a way that allows me to access the exported symbols as well as their children? working on an action script project in Flash Builder 4. In my SWC I have a sprite called SP_ViewHome. That sprite has a child called mcContent which is another sprite instance.I've included the SWC so that the FB4 recognizes the class SP_ViewHome (and auto completes when I create references to them). But my problem is that I can't access it's child by using the regular syntax for accessing children (compiler error 1119: "Access of possibly undefined property mcContent through a reference with static type flash.display:Sprite")

Code:
public class ViewHome extends Sprite
{
private var s:Sprite;[code]....

I can access that child with the getChildByName() function. However this seems inefficient both in terms of development and run time performance.I need to do to be able to access children of SWC classes more easily?

View 1 Replies

ActionScript 3.0 :: Runtime Shared Library - Main And Assets SWF

Mar 26, 2009

This is the concept I want to get into code:
1) Have a Document Class attached to the Main.swf
2) Have a Assets.swf that has all MovieClips that set to Export and have been given actual Classes.
3) Have the document class Load the Assets.swf.
4) Once loaded, be able to create instances of the MovieClips from Assets.swf by writing the code in the Document Class of Main.swf

I can get all this to work.. However what I am finding is if I have a public function on the Document class that creates an instance of something from the Assets.swf, lets say var okTest:TestClass = new TestClass(); I have to also import it in the Document Class (import com.test.TestClass). When I compile it, yes it works. If I remove the Assets.swf file it doesn't display. Ok.. But I've noticed that the Main.swf file is including all the imported classes (eg: com.test.TestClass) so the Main.swf filesize is pretty much the same as the Assets.swf file.

I also ran it through a decompiler and can see yes in fact Main.swf is including all those Classes from Assets.swf because I'm trying to access them from Main.swf and had to import. So the biggest question is how do I go about this properly? Being able to load the asset file that has movieclips etc that have custom classes. Then create instances of those classes within the document class but only if Assets.swf is loaded.

View 2 Replies

ActionScript 3.0 :: Child-parent Relationship \ Adding Them All As Children Of The Stage And Creating A Parent-child Hierarchy Between Them?

Jun 6, 2011

i am slightly confused about the parent and child relationship. lets assume we have several different instances, what would be difference of adding them all as children of the stage and creating a parent-child hierarchy between them(other than the access path).

View 5 Replies

ActionScript 3.0 :: Shared Custom Event Between Parent And Child Swf On Different Domains?

Aug 23, 2010

I have two swfs for a project, I had both of them to dispatch events to each other. Parent loads child and is listening for the compete load event. Once that event is dispatched to the child - the child dispatches a start event back to the parent. I got this working by copying the ModelEvent(my custom event) in each of the flash builder actionscript projects in the exact file structure ( i think i was cheating it there, since )

It broke when I put the swf on separate domains, so I'm thinking I'm missing something to share the custom event class between two swfs.

[Code]...

View 9 Replies

ActionScript 3.0 :: Parent Width From Children

Oct 20, 2009

Having some strange problem getting a width from objects placed on stage using addChild. I am under the assumption that when I add some children to a specific parent, the parents width will increase and I can use that number to immediately act on the parent. The width is 100 when traced no matter when or where I add the children. I can change it statically but the is a desktop app which depends on screen size.[code]

View 1 Replies

Children Don't Synchronize With Parent Animation

Jul 27, 2010

I have multiple children movieclips containing png images inside of a parent movieclip. The parent movieclip has a slow looping animation. The children don't stay in sync with one another during the animation. It becomes obvious to see because there is a background child clip with other child clips on top of it. It appears to only happen with movieclips containing a bitmap image. Does anyone have an easy fix or work around for this?

View 5 Replies

ActionScript 3.0 :: Synch Parent And Children?

Mar 2, 2009

I have 2 movieClips loading images using XML files.

I need to set the position on this movieclips from the parent depending on their width.

The problem is that the parent have to wait that both children have loaded the images before to proceed.

View 2 Replies

ActionScript 3.0 :: Set Of Movieclips That Are Added As Children To A Parent Mc?

Apr 29, 2010

I have a set of movieclips that are added as children to a parent mc.  I want to scale the parent mc up but keep one of the mc's in the same place on the stage.  I think the easiest way to do that is to scale the mc up, calculate how far the child mc moves and move the parent an equal amount in th opposite direction. Everything works but I can't for the life of me wrap my head around the math required to calculate the distance to move the parent mc.  Has anyone else tried this?  Is there an easier way that I don't know about? 

View 2 Replies

Actionscript 3 :: Removing Parent Memory Used By All The Children?

Sep 17, 2010

I'm making a rather large flash project and so I'm concerned about memory usage. At the end of each section of the application I remove the overarching parent element that holds the content. Although this remove the parent, does this also free up the memory for each of the children contained within this, or should I run an iteration to remove those prior to removing the parent?

I'll give a little more explanation in-case I'm not expressing what I want:

addChild(movie1);
movie1.addChild(movie2);
movie1.addChild(movie3);
By using this code:
removeChild(movie1);

Does it remove movie2 and movie3 from memory or are they still stored, just unlinked?

View 3 Replies

Actionscript 3 :: Event Registrar On Children Rather Than Parent?

Oct 26, 2010

I have setup a "LayoutPage" custom class (based on MovieClip) and I am attemptimg to create a "selected" behaviour.When I assign my "addEventListener(MouseEvent.CLICK,toggleSelection)" from within my custom class, everything works as expected, clicking any object of that class does display the correct behaviour.

Now, I would like to extend the functionality by adding keyboard modifyer to either extend the selection or replace it.For this, I thought of moving the "addEventListener" out of the class and put it inside the parent instead (my "PageLayout" class where all the "LayoutPage" live). But by doing so, the click event no longer register on the "LayoutPage" class but rather on its individual children (Page icon, Page number text field, Page Highlight shape, etc.)

View 1 Replies

ActionScript 3 :: Get All Children On Stage / Parent Object

Feb 1, 2011

How do I get a list of all the children (Sprites) on the stage of my Document Class OR how can I get a list (length) of all the children (Sprites) of a parent (Sprite)?

View 1 Replies

Flash - Children Inheriting Parent's Colortransform?

May 17, 2011

How to avoid children inheriting parent's colortransform in flash?

View 2 Replies

Flash :: Retrieve All Children Of A Certain Type From A Parent?

Jun 15, 2007

is it possible to retrieve all children of a certain type from a parent in actionscript 3?i only see getChildAt,getChildByName, is there a getchild of a certain type like get all childs of object type:Food?!!!

View 3 Replies

ActionScript 3.0 :: Resizing Parent Movieclip Without Affecting The Children?

Nov 14, 2010

What's the best way of  resizing parent movieclip without affecting the children? I have a container movieclip that resizes depending on the stage, and when I add another movieclips to it they also resize, but I want them to keep the original size,

View 3 Replies

Grab All Children Nodes Under The Parent Node In Xml Using Flex?

Jan 27, 2011

I have a parent node and I'm trying to get each child node under that parent and store it into an arraycollection? How could I go by doing this?

View 1 Replies

Flash :: Retrieving Children From Parent Container Of A Certain Type?

Jul 5, 2011

is it possible to retrieve all children of a certain type from a parent in actionscript 3? i only see getChildAt,getChildByName, is there a getchild of a certain type like get all childs of object type:Food?

View 2 Replies

ActionScript 3.0 :: Prevent Parent Resize When Children Is Added?

Dec 23, 2009

I have a rectangular movieClip named 'container'. In this movieclip, a function generates some number of squares.My problem is that; for example, if I generate 12x12 squares with each width/height of 40; it resizes the container to width/height of 480. If I set the width and the height of the container movieClip to a lower value; then the squares become smaller.I have been struggling for some time on this problem. I tried setting the ScaleMode of container and squares to various values but it did not work.How can I overcome this illogical (for me at least) problem? How can I prevent children from resizing their parent OR how can i prevent parent downsizing the children?

View 2 Replies

ActionScript 3.0 :: Resize Parent Movieclip Without Affecting Children?

Nov 14, 2010

What's the best way of resizing parent movieclip without affecting the children?I have a container movieclip that resizes depending on the stage, and when I add another movieclips to it they also resize, but I want them to keep the original size

View 1 Replies

ActionScript 3.0 :: Bring Parent MovieClip In Front Of Its Children

Jun 1, 2011

I have a game set up like so:

DOCUMENT CLASS -->
MASTER LEVEL -->
LEVEL OBJECTS

The MASTER LEVEL is a child of the DOCUMENT CLASS and the LEVEL OBJECTS are a child of the MASTER LEVEL

The MASTER LEVEL is just a border which also shows the time that has passed. The LEVEL OBJECT are stuff like the player and the finish.

The problem is that I can make the player and finish swap depths using setChildIndex but I don't know how to bring the master level in front of its children? Is this even possible or will I have to make a level container that is the parent of the LEVEL OBJECTS and also the MASTER LEVEL. So that the MASTER LEVEL, the finish and the player are all siblings (sort of).

So I am trying to bring a movieClip in front of its movieClip children.

View 5 Replies

ActionScript 3.0 :: Disabling Mouse Actions On Parent But Not Children?

Jun 25, 2010

I'm facing a problem with drag & drag actions on children mc. The parent sometimes moves too.How can I disable any reaction of the parent, without affecting children?

View 1 Replies

ActionScript 3.0 :: Registering (grand)children Dispatchers With A Parent Listener

Sep 3, 2008

I have a Document class called Main.

As a child of Main, I have an instance of a class called NavMenu.

As children of NavMenu, I have multiple instances of a NavLink class: navLink01, navLink02, navLink03, etc.

Back up in the Main class, there is a function called navigateTo, which accepts sectionID variable as an argument.

My question is, what is the best practice to get the navLinks to call the navigateTo function on Main? I've been told that in the spirit of encapsulation, it is not best to pass a reference to Main down to the navLinks, and call the function from there.

But rather, it is desirable to use the event listener/dispatcher method, where the navLinks are dispatchers, while the Main class listens for the navLinks to broadcast their sectionIDs.

While this makes sense, however, don't you still have to pass a reference of the listener on the Main class down through the hierarchy, so that the navLinks are registered as dispatchers? Doesn't that defeat the purpose of encapsulation?

View 4 Replies

Flex :: Mxml - Dynamically Resize Parent Container To Contain Children

Feb 11, 2010

Is there an easy way to make a parent container (eg Group) resize when it's children resize?

Below is a little example app. When I put the 200x200 'food' in the 'stomach' the stomach & it's containing 100x100 'body' should resize to contain the food.

[URL]

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"

[Code]....

View 2 Replies

Actionscript 3 :: Parent Sprite And It's Children DisplayObjects Do Not Fade In/out Simultaneously

Dec 10, 2010

I'm trying to simulate some fade in/out effects in Action Script 3 programmatically, using Timer class and controlling alpha property of the specified DisplayObject in time. In general it works and looks great. As I was expecting. But after I add some more child DisplayObjects to the parent Sprite it starts to behave weirdly. Children seem to not fade at the same rate as parent object and it visually noticeable, and ugly. There seems to be a short lag after parent already started to fade out and before children actually follow. Are there any additional measures I should take to avoid that? I do alpha manipulation only on parent object. I thought that'd be logical...

View 2 Replies

Flex :: VGroup - (Parent) Container Does Not Change Height With Children?

May 13, 2011

I have code like the following:
<s:VGroup gap="10" id="group" height="100%">
<s:Label text="This is page 2" />
<s:Button content="Resize Canvas" click="resize(event);"/>
<mx:Canvas id="photoCanvas" color="#567898" backgroundColor="#125567">
</mx:Canvas>
</s:VGroup>

I don't understand why the following does not work:
Pushing the Button resizes the photoCanvas's height (gets taller or smaller). Since the photoCanvas control is a child element of the VGroup shouldn't the container update itself to the new height? The Vgroup has ALWAYS the same height, no matter what the (total) height of the children is! I would like the VGroup to adjust itself and get a height value equal to the sum of its children heights. Is this not possible??

View 1 Replies

ActionScript 2.0 :: Get The Grandchildren From All The Children Nodes And Assign Them To Each Parent In An Array

Feb 8, 2011

im trying to get the grandchildren from all the children nodes and assign them to each parent in an array.

how many there are or the maybe none should be assigned to an array for that main parent. So basically i can list all the grandchildren data when i load the parent Nodes.

View 5 Replies

ActionScript 3.0 :: Removing Parent MovieClip Erase All Children Objects?

Jul 14, 2010

I have a movieclip which contains other movieclips/loader. Does removing the parent movieclip removes all the children objects?

View 5 Replies

ActionScript 3.0 :: Avoid Children Inheriting Parent's Colortransform Properties?

Sep 8, 2010

this is the issue:i have a series of button that open a drag box with textfield and a close button in it. The drag box has to have the same colour of the button. So here it goes:

Code:
// array of buttons
var quadratini:Array = [muh,miao];

[code].....

View 1 Replies







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