ActionScript 3.0 :: External SWF Asset Libraries - Most Efficient Method?
Jul 28, 2010
I haven't experimented with external SWF's purely as image/sound libraries etc. I generally embed assets and/or load in sound/textures/geometry etc dynamically.
However as I'm starting development on my first game, I would like to use an asset SWF per level, so all images, sounds, models etc are contained in this SWF, nice and clean, just one file loaded per level. No code, just assets.
Not only for the structure, but embedding transparent PNG's is very important, as obviously uncompressed PNG's are pretty hefty, and flash does a great job of it.
So for those with experience of asset SWFs, what do you think is the best method of loading/removing/accessing/managing them?
View 9 Replies
Similar Posts:
Jan 21, 2010
I have an externally loaded swf that contains thumbnail movieclips. When a thumbnail is clicked an external image is loaded. I would like to be able to reposition this external image. I know I can use typecasting to control a movieclip of the swf but how do I control nested externally loaded files? I have a different approach that should work fine but I was just curious about my initial attempt.
View 0 Replies
May 18, 2009
I can make a slideshow by importing 30 or so images and using the timeline. I can make a slideshow by importing 30 or so images and using actionscript so that the timeline is realtively short.
What is the best way? I discovered how to do it by loading a movieclip with the image, but that is risky because depending on the connection, it sometimes loads too late.
What is the most streamlined, small filesize way to make a long slideshow? Can you point me to posts that talk about this or tutorials?
View 3 Replies
Apr 21, 2010
To save people from reading too much, this is the "abbreviated" version, while the next post will contain the "full version" in it's original glory. Here is the deal. I have a "User" class with 4 properties, all Strings. I want to store those instances inside of a "UserList" class. The UserList class has several properties to sort through and find users. Now, at least the "getUserByPrefix" and "getUserByNickname" require to retrieve values very quickly, so (I'm guessing) that options like this are not a good idea:
[Code]...
View 6 Replies
May 9, 2009
I am populating an array employees (shown at the bottom) with data from a MySQL database table. To locate employees that statisfy a complex criteria, I am using a loop like so:
var emplyees:Array = new Array();
var i:int;var counter:int=0;for (i=0;i<employees.length;i++){
if((employees[i].city=="London")&&(employees[i].age<30)){ counter=+; }}if(counter==0){ trace("No such emplyees")}else{ trace("Found "+counter+" employees.")}"
It works fine, but I think it is cumbersome and potentially slow with large amounts of data. Is there a better way of doing this?
[Code]...
View 2 Replies
Aug 19, 2010
When I was building apps in as2 - my main method of project distribution was to create a bunch of different swfs, each representing, probably, a timeline, some code, and a set of graphical assets. Tho cumbersome, it meant that I could progressively load large chunks of the project as needed, at runtime.
Obviously - working in as3 - this changes a bit. My last project ended up being a bit too large, even when all assets had been optimized - mostly because I just embedded them in one swf and loaded it (kinda long load time). So - new project, wondering what solid methods are available for loading packages of external assets. I could, obviously, just load everything individually, but I would like class linkage and symbols already defined - rather than doing this manually for bitmaps.
[Code]...
View 4 Replies
Oct 25, 2009
So I've seen many a tutorial on how to do this in AS3 but I'm trying to work out if there is a way to have all my assets for a game I'm making external, so they can be shared with a level editor that resides in a different .swf and won't be loaded twice.I spent a while looking and found out about Shared Libraries, which at first I thought would solve the problem, until you find out that you can't use attachMovie to attach anything to the stage at run-time if it is an imported object, which just sucks to be frank .So I then thought of a work-around for that by adding these shared objects inside a MovieClip that wasn't shared so I could add that from the stage and access the clip inside using the instance name that I would assign it. This worked fine until I remembered that I had was using several Bitmaps and the BitmapData class, hence if I placed these bitmaps in a MovieClip I can't even assign an instance name to access them to perform the code that I wish to on them.
View 2 Replies
Oct 22, 2011
I have a var that holds the String value for the path to an image. How can I use that to get the ByteArray from that image synchronously?
View 1 Replies
Aug 28, 2009
what are some tricks and tips for making editing across frames quicker and more consistent? For example, if I have an animation with many frames and/or multiple scenes is there a way to add or move an element so that it appears the same way across all of the frames?
View 1 Replies
Aug 15, 2011
interested (or proficient) in multitouch technology with AS3I'm currently doing a multitouch project (ya!), in which touch point and gesture detection is required, using the beta multitouch API in flash, the program does compile but there're some deadly issues about it:
1. The program(in swf form or windows projector form) lag frequently (about 1-3 times in 10sec) when I'm doing gestures, but it runs withno lagging when I open it by dragging the swf file to IE(and other browsers too), wield. (I'm using win7)2. Swipe gesture is not supported, which makes me really isappointed,by the way, touchEvents and gestureEvents can not be used at the sametime, but I've ever seen some smooth flash programs which apparently allowtouch and gestures, how do they do that?Well, the program is very simple but laggy(except swf in IE, of course), so I don't think the main problem for lagging is my code, I wonder if it's just me or it's the problem of the beta API or Flash player, but it's still not comprehensible
[Code]...
View 1 Replies
Jan 13, 2009
Why did Adobe decide to drastically change the language this much?The only reason I can think to revamp something that before was quite simple to something that is more complex is for efficiency. From what I've seen the listeners help reduce filesize by having you only include functions you need, but it also seems like they're trying to become like larger languages such as java and c++.
While I'm sure it's good code ethics to separate code from movieClips and buttons, it's damn frustrating, coming from the 2.0 background. The only reason I can fathom as to why they did this was because there HAS to be some crazy performance boost or something.
Otherwise it just doesn't make sense to axe it altogether.Maybe I'm just complaining about losing novelties but so far I don't like the changes Adobe has brought to Flash.
View 4 Replies
Apr 20, 2010
What method is used to load a flash web in to another flash webpage? Something like Iframe do in HTML. Will loadmovie do it?
View 3 Replies
Sep 6, 2011
i have been working with a few basic flash presentation to learn the ropes. However, I am working on a flash file which, when compiled, pulls in flash content from elsewhere in the Parent folder. I have read through the FAQ and cannot find the answer, as there doesn't seem to be any Actionscript which handles the importing of these external files.
Are there other methods that I am unaware of? I need to edit these other files, however I find it more beneficial to first understand how the Flash file is compiled before editing.
View 2 Replies
Nov 1, 2011
I've learned recently that you can use txt file for simple data too, so I include it here as well.TXT contains (not sure if correct, should have same data kind as the xml):
point1&x=1&y=2
point2&x=1.5&y=2.5
point3&x=5&y=-5
XML contains:
<?xml version="1.0" standalone="yes"?>
<points>
<point1 x="1" y ="2"></point1>
[code]....
What I have:
- I have 2 dynamic textfields: text1 (variable: outPut1) and text2 (variable: outPut2)
- I have 1 input textfield: (variable:inPut)
- I have 1 button
What I'm trying to do:
- When typing point1 in the input textfield and then pressing the button,(onRelease), outPut1 textfield should show the number 1 and outPut2 textfield should show 2.
- Similar, when typing point3 in the input textfield and pressing the button, outPut1 should show the number 5 and outPut2 should show the number -5.
-It is not only for these three points, it should be applicable with say 50.000 to 200.000 more of such points, each with different x and y values.
To sum it up:So Flash (with AS2) should screen the nodes or txt (for those point names) on what was inserted in the input textfield, then fill the corresponding attributes (XML) seperately in the textfields and all that after the button was pressed. The same deal if it was done with txt, if possible (have read that with txt, loading of data would be faster?).
View 4 Replies
Nov 4, 2009
I'm trying to setup VIM for editing Actionscript 3 for some upcoming Flash projects. I dislike working in an IDE and prefer VIM. Right now, I know that I want:[code]I've tried setting up Omnicomplete but was running into issues.How can I set up Omnicomplete with tab completion properly?Where can I find a good AS3 syntax file?What is a good AS3 compiler for terminal/bash?
View 5 Replies
Mar 5, 2010
for (var k in dictionary)
{
var key:KeyType = KeyType(k);
var value:ValType = ValType(dictionary[k]); // <-- lookup
// do stuff
}
This is what I use to loop through the entries in a dictionary. As you can see in every iteration I perform a lookup in the dictionary. Is there a more efficient way of iterating the dictionary (while keeping access to the key)?
View 1 Replies
Jul 15, 2010
I have a bitmapdata object that is filled with n rectangles of a width of 1 pixel and of varying heights.
I want to run through a loop and remove the old rectangle and replace it with a different one.
Should I do something like reset the each bitmap column of pixels to a background color and then add the rect i want?
[Code]...
View 1 Replies
Sep 22, 2010
What way of reading and storing data is fastest for AS3. For debugging right now it is just reading the raw XML, but I suspect it would be faster if I made them into nested arrays. Would parsing the XML into nested arrays to be read later be the most efficient method?, or is there a better way to read lots of data?
View 3 Replies
Dec 12, 2010
I'm doing a lot of keyframe masking of vines/flowers for a project I'm working on, and it looks really good but is, of course, very time consuming.I'm curious if there's any techniques/tools for making these animations faster, and more importantly making them more editable later. I'm afraid I'm going to keyframe out entire sections of animation only for the client to say "Looks great, but can you speed it up just a touch?" and I'll have to rebuilt it all from scratch again.
View 2 Replies
Jul 28, 2011
In main.mxml I have a bunch of textInput controls a combobox and a few checkboxes that I would like to be able to clear with some sort of loop. Right now, I do it like this:
[Code]...
I read a post on SO that recomended adding the controls to an ArrayCollection with the creationComplete event. I tried that and it worked fine but it was not any more elegant than what I have now. All of these controls are in mxml format and not generated with AS by me. I also tried looping like this:
I can't get past that part though. I cannot find a way to reference the values of the control.
View 1 Replies
Aug 5, 2011
I have an activity with 6 buttons. Each button loads a movieclip from the library. Users can click the buttons in any order. The code below shows my long process of checking to see if other movieclips are present and removing them before I add the new movieclip.I'm wondering if there's is an easier way to do this. So far I've only written the code for the first 3 buttons. It is long and creates plenty of opportunities for syntax errors
var answer01:MovieClip = new swap01target();
var answer02:MovieClip = new swap02target();
var answer0
[code].....
View 1 Replies
Sep 30, 2009
I have a google map in my site, and have all the code in the main timeline. I'm pretty sure this is affecting my intro animation due to google maps importing. Is there an efficient way to do this, so that it won't affect the intro?[url]...
View 2 Replies
Dec 20, 2010
I was wondering if there were any tips on the most efficient (least processor heavy) way to add some ambient animation to a set of sprites on the stage (possibly hundreds). i was thinking of just having them pulse or fade in and out a bit every so often just to show some movement.
View 1 Replies
Sep 30, 2007
For this I have up to 16 movie clips with up to 3 fields in each that need truncating. So as you can see 3 x 16 = 48 * # of excess characters; Potentially VERY slow.My current code is:
Code:
mc.displaySongT.text = mc.song;
altered = false;
[code].....
View 2 Replies
Mar 28, 2010
Been fooling around with buttons (OVER and OUT effects) and I�m looking to find an efficient way to work with them. Currently i�m trying SWITCH-statements, which seems to be in the right direction. However, it still produces alot of code. Is there a way I can simplify the code below?
[Code]...
View 4 Replies
Aug 16, 2010
I'm designing the UI for my level editor and I found managing multiple menus and buttons can become complex and annoying to program for every single situation and for every single button. Which as you can imagine it becomes tedious.Imagine you have 2 buttons both of them open drop down menu's when clicked but I only want to have one menu open at any time.To further complicated the situation in one of the drop down menu's there is a button that when clicked it'll open a further sub-menu in place of the previous one.Here is how I've gone about programming such a situation.
PHP Code: [code]....
I want to open menu 1:
checks if any menus are open
if so close them and open menu 1...
...and so on for every menu further multiplying the amount of programming every time I add a new menu. I have to go back to the buttons that open all other menus and program for the occurrence that, the new menu may be open.I was thinking some kind of function could handle all the menu's but my brain is to frazzled to think.
View 3 Replies
Feb 24, 2011
I'm building a website with fadein/fadeout transitions between sections. On button click, a white rectangle on the very top layer (filling all the screen) is faded in. Once ended, the section changes and the rectangle fadeout is started.
It technically works, but I've noticed that the first transition is not fluid, while the next are fluid. Does exist an efficient technique to achieve the goal?
View 8 Replies
Jan 8, 2011
I'm changing scalex of an object over time.
Code:
function onLoop(){
angle+=1;
obj.scalex=Math.cos(angle*3.14/180);
}
The object becomes thiner and thiner. Is there any way how to know where(x,y) is the top left corner of the object?
View 2 Replies
Aug 16, 2009
I created an application to show a datagrid with a custom column in Flex 3. How can I access the method loadDetails in this code?:
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
<![CDATA[
public function loadDetails(id:String) : void { // Some code here
[Code].....
When I tried to run this code Flex throws an error. It says that loadDetails is not defined. I suppose that error is because of scope.
View 1 Replies
Jan 30, 2010
For some reason I cant figure this out,I have a function thats in a method in a class..I have a second method in the same class, trying to call the function from the second methodeg:
Code:
package com.sarin
{
[code].....
View 4 Replies