Flex :: Swapping Movieclips With Other Assets At Runtime In A Flash Component

Sep 2, 2011

I have an animated character swc that is an empty skeleton basically (has all the body parts, animations, and functions/vars). I want to essentially put different clothes on that character at runtime so I don't have to have many copies of this character in my resources.

For example, I have 'skeleton' (the non-clothed model) and 'Bob', 'Jane', and 'Mary' characters. 'skeleton' is animated and fully works as an exported swc, and to get the other characters in their clothes/skins, I open up Flash CS5 and replace the movie clips with the 'clothed' versions of the components. To clarify,'skeleton' has "body parts" as movie clips that are all animated on the timeline, such as "head","face","left arm","right arm", etc. I open up 'Bob', who has the same exact design as 'skeleton', with the exception that 'Bob' has all the clothes and such as differently-designed movie clips. The size, shape, orientation, and reg points are all the same across all the components. After I've replaced all the movie clips in 'skeleton', I export it as a swc named 'Bob.swc' and I do this for all the characters.

What I'm asking is, how can I do this process ^, but at runtime instead, so I don't have all these duplicate root swcs ('skeleton' has a lot of frames on it) so I can cut down on a bunch of space? So I can do something like:

// bob gets all the actions and animations of skeleton
var bob:UIMovieClip = new skeleton()
// replace the body movieclip with a new looking one
bob.body = resources.bodyassets['bob']['body']

View 1 Replies


Similar Posts:


Flex :: SWF Assets Loaded Into Flash SWF At Runtime Within Same ApplicationDomain

Dec 1, 2009

I'm trying to load a swf compiled by the Flex SDK into a swf exported by the Flash IDE and instantiate the assets by way of getDefinition(). Normally this works fine with assets exported from the Flash IDE then loaded into another swf also from Flash IDE.This is how I could normally do this using only the Flash IDE:Loader - > Using same ApplicationDomain - > getDefinition(class)Now, using the 'Test.as' compiled from Flex SDK using the [Embed] metadata tag:Loader - > Using same ApplicationDomain - > getDefinition("Test_" + class)The problem is I'd rather not have to keep track of the asset libraries loaded to prefix the class name I'd like to get (('Test_" + class) vs (class)). Is there any way of doing this without referencing the library the class is being pulled from or without accessing the original loader? This way I don't need to know which swf the asset is coming from, just the class name that I could instantiate from the current ApplicaitonDomain.

View 1 Replies

ActionScript 3.0 :: Flash Palette Swapping At Runtime?

Nov 29, 2011

Well we've all probably seen the "Mortal Kombat" ninja before. But how possible is it to do this with AS3 using a bitmap in a mc. I have searched all over the place for a tutorial on how to go about this but I can't seem to find anything that suites my needs. Do you think Flash has the power to do this at runtime for a game?

View 14 Replies

Flash :: Create Reusable Component Which Contains Assets In CS5?

Feb 26, 2011

I need to create slideshow for gallery. And one thing that i don't know is how to create reusable components. For example i want to create 3 components ImageLoader, Dock(that consist drom ImageLoaders) and SlideShow(that consists from Dock and ImageLoaders).

ImageLoader it is a container which loads image and while it loading showing some animation
Dock it is a container wich have few of ImageLoaders, it used to create Dock of thumbs images to chose.SlideShow it is a container wich have few of ImageLoaders, it used to preload images to ImageLoaders and the change them on mouse click.I need that all of this components was accessible fom action script, so i can create new instances of them.

Example code:

im1 = new ImageLoader('../im1s.jpg');
im2 = new ImageLoader('../im2s.jpg');
dock = new Dock(new Array(im1,im2));
ss = new SlideSHow(new Array(im1,im2),dock);
ss.init();

View 2 Replies

Actionscript 3 :: Flex 4 - Add New Component At Runtime?

Feb 1, 2011

I'm looking to make a "Generate component" button that will add a new component such as a Button to a Group. There could be any number of components added, so I don't want to use states. How can I do this?

View 1 Replies

ActionScript 3.0 :: Modifying Library Assets At Runtime?

Feb 19, 2010

I'm building an avatar class that will allow a user to swap out character assets during runtime. The idea is pretty straight forward. The artist I am working with designed the art assets for the individual pieces of the avatar and performed the animations in flash. Since the animations were created in flash using vector art as opposed to pre-rendered 3d, I want to simply replace each individual movieclip within the animation with the asset selected by the player.

Problem:The issue i'm running into is that the animations have several key frames. My thought is to load the avatar object (an external swf) into my main application. Once loaded, I obtain a reference to all library assets that are used in the animations. For example, to get the face, I have something like:

Code:
if(this.loaderInfo.applicationDomain.hasDefinition("face"))
{

[code].....

View 4 Replies

Flex :: Adobe - Possible To Clone Component At Runtime

Jul 6, 2009

I am trying to duplicate a flex component at run time. For example if I have this:
mx: Button label="btn" id="btn" click="handleClick(event)"/>
I should be able to call a function called DuplicateComponent() and it should return me a UI component thts exactly same as above button including the event listeners with it.

View 6 Replies

ActionScript 3.0 :: Switching From Embedding Assets To Loading At Runtime?

Mar 8, 2011

I have been handed a project that was built to embed all assets at compile time and I need to update the app to load assets from a remote server instead. Right now everything is being embedded as follows:

[Embed(source="assets/gfx/tutorialBg.png")]
public var tutorialBg:Class;
[Embed(source="assets/gfx/tutorialStraightArrow.png")]

[Code]....

These Class variables are being referenced all over the app to place the assets so I'm hoping to be able to update the code to load the assets and store them in these same Class variables. So far the methods I've tried have not worked. I've tried using URLLoader and it loads the images fine, but I'm not then able to extract the image and cast it as type Class to these variables.

View 0 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 1/2 :: Swapping MovieClips In And Out Of Area

Oct 7, 2009

I'm trying to swap movieclips in and out of an area, rather than loading an endless number via attach/getNextHighestDepth. Is there a way to swap my attached movieclip A with a new attached movieclip B, so that either clip A or Clip B is loaded, but not both? Because my current program uses attached files of identical size that overlap, I didn't realize there was a problem until things slowed down. I checked my number of objects in the debug list between hitTests and lo and behold, the list of objects got longer each time, even though to the viewer, it looked the same.

View 4 Replies

ActionScript 3.0 :: Swapping Depth Of MovieClips?

Aug 30, 2010

How do you go about swapping depths in AS3? I've got a movieClip (allContent_mc) that contains a bunch of other movieClips(mc1, mc2, etc.) that expand in size when clicked on. However, when they are expanded I need to make sure that the one being viewed is on top. The control to expand each clip lives within each clip itself. Ideally, when the expand code (below) is executed, I'd like to make sure the clip's depth supersedes all others. I'm keeping all the clips together in one larger clip because the larger clip is living inside a scrollPane component. Pretty sure I'm just not defining the path to the clip correctly.

ActionScript Code:
function goOpen(e:MouseEvent):void{
this.setChildIndex (square_mc , this.numChildren - 1 );[code]...........

View 7 Replies

Actionscript 3 :: Runtime-loaded Assets Consume Memory/resources If They're Not Being Used?

Mar 12, 2012

I'm making a game for the browser that has a lot of assets, but not all of them are needed at once. I'm deciding whether to embed my assets at compile time or load them at run time. I'm not concerned about loading time -- only the performance of the game during run-time.

If I load these assets and store them into memory for eventual use later in the game, will they consume system resources just being latent in an AssetLoader? Will that affect performance?

If I embed these assets, will they consume system resources just being latent in the compiled SWF?

Is there a difference in performance between these 2 methods?

View 2 Replies

ActionScript 2.0 :: Swapping Between Multiple Movieclips And Positions

Feb 2, 2009

I've 6 different movieclips on stage, with one main focal movieclip in the center. What i need is that when clicking on the surrounding movieclips they animate in to swap their position with the main focal movieclip, which then animates to take it's replacements former position. So after a few mouse clicks all of the movieclips could have had their position shuffled from it's original location.

I know i've seen a similar thing on a photo gallery where the current photo is swapped with whatever thumbnail is clicked on but can't seem to find an example.

Currently i have the positions of the movieclips controlled by variables, the animation handled by tweener, and can quite happily find the position/scale etc of the movieclip that get's clicked on, but can't figure out how to get the focal movieclips details as it might never be the same movieclip.

View 2 Replies

Flash :: Self Updating Air Application Assets Without Re-downloading Assets Already Downloaded

Feb 10, 2011

I want an air application to be able to update the assets it uses, but minimizing the download needed, so only downloading files added since it last updated.I'm thinking this would include a server portion which would zip the needed files based on a version number? Has anyone implemented anything similar / got any thoughts on the best approach to building this sort of system?

View 1 Replies

Flex4 Component Kit For Flash Loading At Runtime

Jan 11, 2011

I created few flex components in flash using flex component kit for flash. It generates a swf and a swc file. my question is, how can i load these flash created flex component at runtime and use them.

View 1 Replies

ActionScript 3.0 :: Flash Connect Movieclips In 3D Space At Runtime?

Jul 26, 2010

HI have various instances of a movieclip spread across 3D space. The user is able to navigate across the 3D space using the mouse or the arrow keys -I've used a style similar to the old school first person shooter games. Some of the objects on the stage are related so I want to connect them with a line to show their relationship. As all my objects are dynamically created through AS at runtime the relationships also need to be dynamically generated. As the user navigates around the 3D space the line between the objects needs to get redrawn.In a 2D world I'd use the drawpath or moveTo/LineTo methods to join the movieclips and have a function on the onEnterFrame command of the 3D space to keep redrawing the line.However since this is a 3D world I need to take into account the z location of the movieclips as well as the x and y locations. Does anyone know how I could do this or even point me in the right direction to get started?

View 2 Replies

Editable Assets Within A Swc-based Component

Nov 5, 2009

I created several swc-based components with AS3 and Flash CS4 extending the UIComponent structure. After exporting a fla-based component to a swc-file i created a flash-extension with the Adobe Extension Manager and installed the component.This swc-based component works fine and shows up in the component panel, but i'm not able to edit the components assets because they don't show up in the library anymore.Can someone please tell me if there's a way to export the components assets respectively the components symbols with the swc-file in order make them editable and show up in the library of the FLA which's using the component?

View 1 Replies

ActionScript 3.0 :: Get Component Assets To Appear In The Symbol Library Of Main Fla File?

Sep 16, 2010

I have built a component, but the assets do not appear in the symbol library of the destination fla when I drag the component to the stage. This is fine, except that I have embedded a font in the component. To ensure the font exists in the destination swf, it must exist in the symbol library of the destination fla.My component extends the UIComponent class, and I have a component shim, although I'm still not entirely sure of its functionI have followed all of the steps found in the 9 part MenuBar tutorial, and everything works, except for this one issue.

View 2 Replies

Actionscript :: Embedding Flash Assets In Flex Project?

Jan 28, 2010

I'm creating a project in flex builder but it's not using the flex framework, it's just pure actionscript.

At the moment I have some bitmap resources embedded for drawing things, but I'd like a little animation and thought I could create swf animations for them in flash and use the [Embed()] thing to embed them in the actionscript project.

This works perfectly well for me, however I'm a little concerned about efficiency and how well this approach will scale when my project gets larger.

Does anyone know if there are any efficiency implications to embedding maybe 20 or 30 swf files, or do they get efficiently integrated into the main swf file? Most of the animations are really simple and I could probably redo them in actionscript if needed but it's a lot easier just to draw them in flash and embed them.

View 1 Replies

Flash :: Flex - Using The Vanilla Preloader To Load Additional Assets?

Jan 27, 2010

I have a Flex application that automatically loads the SWF and it's contents and displays the default progress bar like in all Flex apps. Currently I have a class in the application using a Loader instance to load an external bitmap to be added to the stage/canvas. I'd like to handle the loading of this bitmap in the Flex default preloader and get rid of the Loader instance entirely.

View 1 Replies

Flash :: Flex - Statically Embedding Of Assets File Weight?

Mar 21, 2012

When embedding assets of any size in the following manner -

[Embed(source="../../assets/Assets.swf", symbol="LargeButton")]
public static const ButtonAsset : Class;

it looks like the resulting SWF size jumps up ~2.8KB (in addition to the size of any assets that are actually embedded).

So I have a few related questions:

Is this because flex_sdk/frameworks/libs/core.swc must be statically linked? Is there any way to get around this restriction, perhaps by cherry picking the necessary files and compiling them to a SWC file?? Note that in the app I am writing file size is critical.

Is there a command/plugin that would allow for the transcompiling of vector graphics (drawn in the Flash Professional Authoring Environment) into raw ActionScript 3 ?

Use cases compelling this feature are improved workflow - would allow designers to draw assets in Flash Professional, compile to an asset SWF, and then be able to embed those assets (versus having to take the time to load them at runtime, or going to the effort myself to write them in ActionScript).

View 1 Replies

Flex :: Swapping Columns And Rows Of DataGrid Possible?

Jul 22, 2009

I have a 1 row, many column flex datagrid. I would like to turn the dataGrid on its side, so that the column headers become a single column running down and v.v. Is there a way to do that in the DataGrid? Or am I stuck manipulating the data presented to the grid?

I have an object like:
x=y
b=u
o=p
u=e
w=p

And I'd like a control that is visually similar to that. Currently the datagrid displays the object as:
x b o u w
y u p e p
Which is too horizontal for my case.

View 2 Replies

ActionScript 1/2 :: Add And Swap Movieclips During Runtime?

Apr 22, 2009

I figured out how to add and swap movieclips during runtime, but how do I insert script into it?

View 7 Replies

ActionScript 2.0 :: Duplicating MovieClips At Runtime?

Apr 10, 2006

I'm in a bit of a pickle and was wondering if anyone out there .

function RotateDisplayOrDrag(whichPiece) {
if (Key.isDown(18)) {
_root[whichPiece]._rotation += 22.5;

[code]....

View 3 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

ActionScript 3.0 :: Connect Movieclips In 3D Space At Runtime?

Jul 27, 2010

I have various instances of a movieclip spread across 3D space. The user is able to navigate across the 3D space using the mouse or the arrow keys - I've used a style similar to the old school first person shooter games. Some of the objects on the stage are related so I want to connect them with a line to show their relationship. As all my objects are dynamically created through AS at runtime the relationships also need to be dynamically generated. As the user navigates around the 3D space the line between the objects needs to get redrawn.
 
In a 2D world I'd use the drawpath or moveTo/LineTo methods to join the movieclips and have a function on the onEnterFrame command of the 3D space to keep redrawing the line.However since this is a 3D world I need to take into account the z location of the movieclips as well as the x and y locations.how I could do this or even point me in the right direction to get started?

View 3 Replies

ActionScript 2.0 :: Creating Movieclips And Displaying Them At Runtime?

Jun 17, 2009

I'm trying to create a container movie clip, then inside that, create several other movieclips with an image in each and display them with an offset x.It does the offsetting but only displays the last one at the last x.When i dont put the clips in a container it works fine. but i want them in the container so that i can movie the container around on a press.

Heres the code:

var itemsArray = new Array("pic1.jpg", "pic2.jpg", "pic3.jpg", "pic4.jpg");
var clipArray = new Array();
_root.createEmptyMovieClip("carousel", this.getNextHighestDepth());

[code]....

View 1 Replies

ActionScript 2.0 :: Space Evenly MovieClips In Runtime?

Aug 16, 2009

How to "space evenly" movieclips in runtime usin actionscript?

View 2 Replies

ActionScript 2.0 :: Use The Same Movieclips But Be Able To Have A Function Lay Them Out At Runtime In Two (or More) Layouts?

May 18, 2003

I want to use the same movieclips (some are button movieclips) but be able to have a function lay them out at runtime in two (or more) layouts. Just the _x and _y position like in this example:I'd like to layout the mcs with just actionscript. So it can be hardwired into the movie's script with parameters A yielding layout A, et cetera.

something like this:

Code:
boxOne_mc._x = 100;
boxOne_mc._y = 100;
boxTwo_mc._x = 200;

[code]....

but all wrapped up in one function.

View 14 Replies

Bind A Component To An XML Node Dynamically At Runtime?

Sep 13, 2010

I have a custom component based on mx:ComboBox. Within it I connect to an HTTPService (the url is passed as a paramter) and bind the combobox. Parameters to be sent to the HTTPService are passed to the component. This is working fine. But I want to modify it to make it re-usable with other HTTP service URLs, which return the XML in a different format.

My challenge is how can I bind a custom component to a node dynamically at runtime?[code]...

View 2 Replies







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