Actionscript 3 :: Manage Loaded Assets?

Jul 23, 2011

I'm working on an AS3 project that must load a lot of external files; images, sound clips, movie clips etc. The program first loads an XML file that contains the file names of all assets needed by each class. From that point on I'm not sure what would be the best way to distribute those assets.I thought about making a dedicated assets class that will load everything the XML object describes, and then pass it to each class' constructor so they can access the objects they need. This seems like the "tidiest" option, but is there a best practice way for managing loaded assets?

View 1 Replies


Similar Posts:


Actionscript 3 :: Flex - Manage Size Of Image Assets In Mobile Apps?

Feb 10, 2012

Due to screen density of iPhone, image assets are developed larger. So, when specifying the icons and images to Flex components takes this form.

<s:ViewNavigator id="tab1" label="Tab1 width="100%" height="100%" firstView="views.Tab1">
<s:icon>
<s:MultiDPIBitmapSource source160dpi="@Embed('assets/tabIcon.png')"/>
</s:icon>
</s:ViewNavigator>

Flex of course renders this correctly and adjusts the size to what it should be. However, when I load images myself, they appear blown up as they would appear double in size. This is how I use it when overriding the tab bar.

[Code]...

View 1 Replies

ActionScript 3.0 :: Externally Loaded SWF Assets

Jan 30, 2009

Can anyone explain the model for actionscript in externally loaded SWF assets? For example, suppose the stage owner uses methods from Class1 and that it loads an SWF file with an asset that also uses methods from that class. This means the code for Class1 is included multiple times in the application?

View 3 Replies

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

Web Development - Assets Loaded In Flex / Images Wont Update?

Nov 11, 2010

I build a project with Flash Builder. I copied everything from the "bin-debug" directory to a server (including all images we use which are under /assets).

After I have updated the project, and a few images, i recopy the primary .SWF file (Main.swf) and everything under assets up to the server again. Unfortunately, when I run the application, I am clearly running all of the updated code but the images have no updated.

The new SWF was definitely copied up as well as the new images (I can say that with 100% certainty), and additionally, I cleared my Flash Cache, so that's most likely not the problem either.

[Code]...

View 1 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 3.0 :: Can Buttons/assets Be Loaded Externally And Referencing Dynamic Content By Name

Jul 30, 2009

I have a widget containing a number of displayobjects, i.e. up arrows, down arrows, tab 'buttons', backgroundrectangularblocks, sliders, company logos etc.I am currently creating these displayobjects using the graphics class with parameters taken from an external file, things such as fontsize, font, colour, width, height e.t.c and adding them as children of "container" sprite objects for easy manipulation and referencing later can these assets be loaded in their entirety externally, rather than being created using graphics class draw methods (which I want to avoid) as some of the things I need to design cannot be created in pure actionscript very easily (if at all?), and then used or do they always have to be in the library and instantiated from there?

if the first question is yes they can be loaded externally, this question probably isn't needed; however, if I have to put the items in the library and recompile each time a client wants to use say a curved blue up arrow instead of a yellow one and then decides he wants a yellow circle instead then how do I write the code to do the following:-Say on my first ever compile I have 'upArrowBtnset1' in the library, I instantiate it and use the instance name to access it in the usual way using standard code,

upArrowBtnset1.addEventListener.... container.upArrowBtnset1.scaleY = .3 e.t.c

Now if they send me a second set of 'upArrow' graphics they want to use I could either update all the upArrowBtnset1 assets with the new graphics meaning the original set is no longer available to the client and I would either have to hold a "original set" FLA file with the first set of arrowbuttons or I could import these to the library as upArrowBtnset2 and a third set they send as upArrowBtnset3 and so on each time I am sent some new assets; I would then recompile them into the SWF and adjust the references to the new assets within the code. In the code, for each instance of "upArrowBtnset1" I would have to rename them to "upArrowBtnset2", recompile and send it back to the client.

Because I have already abstracted the font/colour/size choices out to an external file, they can change that as much as they like without a recompile which is what we want. The problem comes if they want to use set1 again and haven't kept the original "set 1" compiled SWF. It would be easier to abstract the 'setchoice' also to the external file. The SWF would over time build more and more available sets that they could use by just changing an external variable.

For example, if the designer wants to use set 1 on Monday, set 2 on Tuesday and set 3 on Wednesday I want to make it so they can just adjust an option in an external file to "setchoice = 3" for weds instead of either having to recompile the swf each time or they have to have 3 versions of the SWF for each asset set. The idea is that as more and more assets are added in, they have more and more choices. Ideally, in an external file there would be a list of assets and links to where they are loaded from. (i.e question 1 above).

If I have an external file (say XML) which holds the setchoice option that the designer wants to use (say they want set3 today) my 'generic' code has to be something like upArrowBtn(setchoice).scaleY and every instance in the code where that object is used I append the 'setchoice' as chosen by the designer from the external file where (setchoice) is retrieved from something like var setchoice:String = "set3"; from the external file (I am currently abstracting all the adjustable variables to a configuration.as file. I will work on using an XML later when the principle of external files works (I hope!);

Is it possible to import assets from external sources and then use them in the SWF as if they were in the library? The loader class? Is this just fraught with danger I wonder.

Essentially I am being asked to remove as much as I can from the SWF so that if the client wants to change the positioning of things on the stage or the text on buttons or change the style of the buttons or the company logo they don't have to come back to us to ask for a recompile of the SWF for each tiny adjustment. Inevitably SOMETIMES a recompile will be unavoidable (such as if they want the widget to suddenly be twice as wide (i.e. the stage). My code already handles some of this using stage.stageWidth and then positioning objects relative to other objects already on the stage using this value and centred so that just changing the document properties is all I would have to do and everything else adjusts proportionally. I am trying to make this as reusable as possible with as little effort from myself as possible to save our company wasted time.

After all that waffle, my question is this, if I can't load all my buttons and assets and things externally, how do I write the code for this:- I have a library asset called upArrowBtnset1 and another called upArrowBtnset2. Instantiated with say upArrowButtonset1 and upArrowButtonset2 The code would normally be upArrowButtonSet1.x = 100; upArrowButtonSet2.y = 300; but I need it to be upArrowButton(setchoice).x = 100; upArrowButtonSet2(setchoice).y = 300; where (setchoice) comes externally from var setchoice:String = "set1";How does the code change if the (setchoice) string was named not at the end i.e 'button(setchoice)UpArrow'?

ActionScript Code:
var numClips:Number = 5;
for (var i:Number = 0; i < numClips; i++)

[code]....

I need to do something like, getChildByName("mainTab"+i).addChild(myMovieClip) ? or maybe this["mainTab"+i].addChild(MovieClip)?Is it possible without using .name?

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

ActionScript 2.0 :: [F8] Can't Manage Thumbs?

Apr 24, 2006

Just want to put the thumbnails in a movie clip.Not any thumbs are appearing, there is a mc on stage, there are images and thumbs, there is a xml_fileďż˝

Code:
var gallery_xml = new XML();
gallery_xml.ignoreWhite = true;
gallery_xml.onLoad = function(ok) {[code]...

View 14 Replies

ActionScript 3.0 :: Manage Code Via Package?

May 24, 2009

My code structure is

FlashTesting --> folder contains
Test.fla with one button called cmd_button
engine --> folder contains

[code]....

When I compile output says 1120: Access of undefined property cmd_button

folder structure
FlashTesting -->engine--->code

All I want to access cmd_button to add EventListener which is in code folder. Seems can't access fla components.

View 7 Replies

ActionScript 3.0 :: Manage Mc Timeline From Main?

Jun 17, 2009

I need to use gotoAndPlay with a timeline situated within a MC. So, how can I identify this timeline from the main one?

View 2 Replies

Professional :: How To Manage Big Flash Projects

Feb 4, 2011

I have a very big proyect completelly developed in FLASX MX PROFESSIONAL 2004. In order to manage it,I have divided the file in several parts. What I want to do now is to connect that parts and compile them as a Whole.

View 12 Replies

Professional :: How To Manage Multi Language

Dec 24, 2011

I have swf file containing a game with english language. for question sake will call it mygame.swfNow what I want to do, is to take the fla file and translate it to french and german and save to differen swf files.So now i have:English - mygame.swfFrench - ygame_fr.swfGerman - mygame_gr.swfSame game, different language.My question is: what is the acceptible / good way to contain text in fla file so it will be in one place? like hashtable or some array?I am developer, just not flash developer this is why Im trying to consoult Im not interested in keeping data in external files (xml), I want everything to be keept within swf.

View 1 Replies

Flex :: How To Manage Cookies In Mx:HTML

Jun 3, 2011

I use AIR HTML component, and I need to delete cookies sometimes. I have to open IE and delete cookies there... Can I do it via AS code?

View 1 Replies

Flex :: MVC - How To Manage Notification For Particular Screen

Dec 19, 2011

PURE MVC - In my application there are multiple screens which are minimized like in windows desktop. Now each has different instances of mediator which have same notification. So if I do changes in one screen say press some button >> which sends some command >> to proxy >>then proxy sends notifications to mediator. But as multiple screens are active there it is showing changes in all screens as they are notified too by proxies. How to make sure that proxy calls to particular view component (mediator) and not for all live instances of mediators ?

View 1 Replies

ActionScript 3.0 :: Manage Sound From An External SWF?

Feb 3, 2009

I wrot a FLA in AS3 which is basicaly a nicly designed Loader which loads little cute SWF games. Each game is built a bit differently and has its own 'thing'.I was wondering, how can I control the sound of the SWF's from the Loader File?

Which leads me to a wider issue of how can I control variables of a loaded SWF.

View 0 Replies

ActionScript 3.0 :: Way To Manage Random Effect

Nov 13, 2009

I could able to make random movements in a movie clip. but i want to adjust the moving speed and direction of it.

View 0 Replies

ActionScript 3.0 :: Dynamically Manage Playhead?

Nov 18, 2010

I'm trying to contol the amount of time that a video plays, using netstream. I need to have the stream stop or pause after a amount of time... Here is the code...

var flvPlayback:FLVPlayback = new FLVPlayback();
var flvPlayback1:FLVPlayback = new FLVPlayback();
var cuePt:Object = new Object(); //create cue point object

[code].....

View 5 Replies

ActionScript 3.0 :: Cannot Manage To The FocusSkin For A Datefield

Apr 5, 2011

I cannot manage to the focusSkin for a datefield.

In my css I have done the following:

mx|DateField { focus-skin: ClassReference("skins.myFocusSkin"); skinClass: ClassReference(".myInputSkin"); }

My focus Skin is as such:

import spark.components.supportClasses.SkinnableComponent ;
private var _target:SkinnableComponent;
public function get target():SkinnableComponent

[Code].....

However, when the datefield gets focus, I get the following error :

TypeError: Error #1009: Cannot access a property or method of a null object reference. at skins::myFocusSkin/updateDisplayList()

View 0 Replies

ActionScript 2.0 :: Cannot Manage To Get The Clip To Move

Oct 11, 2007

I have a simple test for how I want a game im making to work. A movie clip is placed on the stage, upon which I want it to start floating to the top of the screen according to given x and y coordinates. But I cannot manage to get the clip to move.

View 1 Replies

ActionScript 3.0 :: Manage Timing - Run The Functions One By One?

Oct 27, 2009

I would like to know how to manage timing in AS3.Let say I have some functions in a code and all of them trigger an animation.

A) I would like to run the functions one by one, but next function must not be triggered before the animation of the previous one is completed

B) I would like to run the functions one by one, but next function must be triggered certain time after the animation of the previous one is completed.

View 7 Replies

ActionScript 3.0 :: How To Manage Amount Of Movement

Mar 9, 2010

URL...The problem is controlling which are the elements to be moved, and mostly, how to manage the amount of movement. When I open a submenu, I've got to move all the subsequent buttons down. But when I close a submenu, I've got to move them up. If I'd do it in different times, no problem.

View 5 Replies

ActionScript 3.0 :: How To Manage Large External Images

Dec 6, 2008

I'm creating a movie object using images. I'm using PNG file types with an alpha channel. Each frame is approx 640 x 480, each single pitch image is 36 frames creating an image 23040 x 480. If it's a multidimensional image it is 23040 x 11520. I load the image in using "img_name".loadMovie("imageFileName", 1);

The problem is it only seems to load around 2880 pix of the image.

How can I get it to load the whole image? How can I choose it to load the next section of the image?

View 3 Replies

Media Server :: Automate And Manage Streams?

Jun 3, 2009

Does anyone know if it's possible with any of the Adobe products to automate and manage streams?
 
We've got a project that will be streaming pre-recorded video and music. Due to the number and frequency of these streams we need a way for us to automate and manage these through our own CMS system.
 
We will be ultimately pushing these streams out to our CDN provider so no end user streaming actually required.

[Code]...

View 5 Replies

Media Server :: Manage Video Files?

Jul 7, 2009

I have installed the development media server, played arround with some of the demos and now i'm looking for the possibilty to manage my VOD video files. But i can't find any tool, or informations delivered by the server how much video files are in the vod directory.

View 3 Replies

ActionScript 3.0 :: Manage The Target Of A Mouse Event?

Feb 13, 2010

how to manage the target of a mouse event. As everyone knows, if I use localX/Y property on a mouse event, I'll get the x/y coordinate of the curson referred to the target Sprite. But if I need these coordinate referred to another Sprite, layed in the bottom of the stage (therefore unreachable for the event), how can I do for these?

View 1 Replies

How To Manage Sound Objects In Large Presentation

Oct 12, 2010

Part of a larger presentation I've made, there is some background music. What happens is an XML file is read to get a file to play. It plays. When it finishes, it reads the XML again to get the new file. It can also stop when a video plays elsewhere in the presentation then I pick it up where it left off and start the process again. Trouble is, the presentation randomly stops. The music stops and the slides in the presentation stop. The music and slides come from a single XML file. There's also a third part of the presentation (a text crawler) that never stops.

This comes from a totally separate XML file. I never get an error, the presentation just stops on a slide and no more music plays, but the crawler keeps crawling. I've removed all the code for the music and it runs perfectly so it's obviously related to how the music is managed. So, finally, my question is how do I manage sound objects? If I need to create new objects for each sound I load and play, I'll need to do manage the sound from a single function, right? Something like:

Code:
function whatever():void {
if song is not loaded {
read xml, load and play song;
} else if video is playing {
pause the song;
} else if video has stopped playing {
resume song;
}}

View 4 Replies

Actionscript 3 :: Manage Event Listeners In For Loop?

May 5, 2011

For loop contains an event listener function. but loop iteration is quicker than listener function.Before the listener function completes next iteration starts. how to handle this?

View 2 Replies

Flex :: Manage Windows In External Applications?

Feb 6, 2012

I have 2 AIR applications (A and B) that are able to communicate via a LocalConnection object. I've verified that messages are definitely being sent/received appropriately.

I want to be able to have A tell B to come to the front. Both applications are full screen:

stage.fullScreenSourceRect = new Rectangle(0, 0, 1080, 1920);
stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;

I've tried several permutations, but as of yet nothing seems to work.

private function initSlave(channel: String): void {
conn = new LocalConnection();
conn.client = {

[Code]...

If I leave both applications in windowed mode (stage.displayState = StageDisplayState.NORMAL), then toggling alwaysInFront actually works. Calling activate() or orderToFront() still do nothing. If I try to toggle alwaysInFront and then set the application to fullscreen, the application ends up fullscreen behind my windowed app. Maybe there is an event I should wait for before setting the app to fullscreen?

I found a thread mentioning that orderToFront() only works relative to windows within the same application, which explains why it doesn't seem to do anything.

Does anyone have any insights into pulling this off? Maybe there is a way for me to embed B into application A so they are actually the same application? I am not sure how to do this with an AIR application as simply as just loading the SWF due to requiring external resources.

View 1 Replies

ActionScript 3.0 :: Manage The Depths Of The MCs Was A BubbleSorting Algorithm

Feb 5, 2009

I'm currently working on side scroller that has an isometric-type perspective (think Double Dragon) and the only thing I could think of to use to manage the depths of the MCs was a bubbleSorting algorithm.

[Code]...

Now this works fine (because I don't have a huge amount of MCs to sort), so I guess this is more of an academic question. As far as I know, bubblesorting is pretty much one of the worst sorting algorithms out there. Has anyone successfully adapted a better one for this purpose? Not trying to get you to post your code as much as just an idea for me to play around with because I'm a geek like that.

View 0 Replies







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