I'm looking for the most efficient possible way of drawing an 8 x 4 grid (960x600 total size). Each square of the grid has a variable alpha and the grid is redrawn every enter frame. The problem is my application is doing a lot already and I'm looking for the most efficient way to execute this loop 32 times (possible more in fact) per frame without overloading processor.
Code: private function init():void { var dimensions : Array = [ 0, 0, 960, 600 ]; var gridRaw : Array = [ 8, 4 ]; var stageRect : Rectangle = new Rectangle( Number( dimensions[0] ), Number( dimensions[1] ), Number( dimensions[2] ), Number( dimensions[3] ) ); [Code] .....
I'm under the impression there could be better ways of drawing the shapes straight to BitmapData without using Sprites, or maybe I'm doing something wrong about memory usage as I can see memory going up and down in a cycle.
I'm using the build in Flex Dataservice to connect to a BlazeDS server. Flex is using the *.fml file within the model folder for the connection details, within that file you can find the following:
the _super_Database class created by Flex DataService uses that configuration to setup a remote object for communications.Now i'm looking for a way to overwrite those settings within the Database class which extends the _super_Database class.
I'm currently trying to built a little Air Application where I want to set the normal Command-C key to call a function? Is this even possible to use a standard Menu Command?
function createMenu():NativeMenu{ var menu:NativeMenu = new NativeMenu(); var menuOneCommand: NativeMenuItem = menu.addItem(new NativeMenuItem("Menu 1")); menuOneCommand.keyEquivalent = "C"; //Command Shift C menuOneCommand.addEventListener(Event.SELECT, myfunction); return menu; }
Moreover I would love to know how I can call a function (myfunction) which is actually a MouseEvent Handler? function myfunction(e:MouseEvent = null) { trace('Throws Errors at the moment')}
When I publish the file, I'm getting the following error message in the Output panel:
**Error** Scene=Scene 1, layer=Layer 2, frame=1:Line 7: The class or interface 'BitmapData.loadBitmap' could not be loaded. var plaid:BitmapData.loadBitmap("plaid");
I am trying to use the reflect class from "http://pixelfumes.blogspot.com/2007/03/reflection-class-v3-with-source .html" but I keep getting this error:
ArgumentError: Error #2015: Invalid BitmapData. at flash.display::BitmapData() at Reflect() at Site_fla::GalleryPage_29/loadThumbs() at Site_fla::GalleryPage_29/sortXML()
[Code]...
btw, first I used assigned thumbContainer as the mc argument (outside the loadThumbs() function) and it worked but not exactly what I wanted... because I thought it is supposed to update when the movieclip is animated but it actually didn't... when I use a scroller, only the thumbs that are first loaded to the stage get the reflection..
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?
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.
I am using attachMovie function to dynamic attached MCs depending on the database. How can I overwrite the current attachMovie MCs with a new set of MCs at the same position and location after a click on a next button?
To my knowledge this doesn't break Liskov's Substitution Principle as an instance of a subclass can do all the things that an instance of a superclass can do.
I am using attachMovie function to dynamic attached MCs depending on the database. How can I overwrite the current attachMovie MCs with a new set of MCs at the same position and location after a click on a next button?
I've been using BitmapData.copyPixels() to draw graphics onto a canvas (Bitmap).I need to rotate the resulting graphics without the use of draw() because it's vastly slower.How can I rotate the target graphic? I'm assuming that there might be a formula or library that I can use which will first reorganize the pixels that make up a graphic based on an origin (point) and radians.I'm pretty certain that I'm not capable of creating such logic, so if there are any known libraries that do this, that would be awesome.I'd like to achieve something similar to XNA's SpriteBatch.Draw() method, which accepts rotation as its 5th argument.
how to use the bitmapData collision method. Now I'm trying to figure out if there is a way to see at what angle or coordinate of the bitmapData the collision happens? I need it in order to figure the accurate bounce angle after the collision occurs.
I'm currently working on a flash game and I need to know how to addChild a BitmapData or draw a BitmapData to screen. If I can't than how can I give a DisplayObject my BitmapData?
I've made a mobile version of my software, with low-res images and such, and I can now fully buffer all my content (including a 360 frame animation which is buffered to memory). Problem is, that everytime I update the view, more memory is used.When I write image = new BitmapData();, does it store the previously created BitmapData's in memory? Do I have to flush the memory somehow before I draw my second picture in BitmapData?Example:
ActionScript Code: // In this example I draw using the same bitmapData several times, also //overwriting the first image. Do I have to somehow delete the data first, to
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?
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?
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
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.
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)?
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?
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.
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
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]...
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.