Does anyone know the real difference between the two ways of type casting in Flex 3?
var myObject1:MyObject = variable as MyObject;
var myObject2:MyObject = MyObject(variable);
I prefer to use the second method because it will throw an Error when type cast fails, whereas the first method will just return null. But are there any other ...
How can I calculate Frequency & Amplitude in As3 with FP9. I got the all raw byte using
SoundMixer.computeSpectrum(_testbytes, false, 0);
var g:Graphics = this.graphics;
g.clear();
g.lineStyle(0, 0x6600CC);
g.moveTo(0, PLOT_HEIGHT);
var m:Number = 0;
for (var i:int = 0; i < 256; i++) {
m = (_testbytes.readFloat...
I'm trying to make a small Flash game that has a GUI, which is basically a menu where players can select certain items, sort of like the Tower Defense games.
Would it be a good idea to make the GUI a singleton? Because obviously there can only be 1 instance of the GUI class.
Is there a better way?
...
I'm trying to simulate a falling balloon in Box2DAS3. What is important is that balloon falls the such that the bottom part were you blow it up rotates towards the bottom if it's knock sideways or is dropped at an angle.
I've tried offsetting the center of mass of the body and also joining two bodies together with the denser one repre...
I find myself frequently outputting PHP Array data into AS3 applications and I'm always having to do it the hard way - comma delimated, base-64 converted data with custom packers/unpackers on either end.
I'd really like an AS3 function that takes the default output of PHP's print_r and converts it to a (potentially nested) AS3 array. Is...
Hey guys...having a math problem. Trying to layout a grid of gray boxes which I want to load thumbnails on top of. I keep getting an error when trying to load the 4th thumbnail. If you remove the 4th person node in the xml it works, but adding the 4th gives me an error?
Code is below.
Any help is greatly appreciated.
package
{
im...
Hey all.
I'm using SWFUpload on a Rails site to allow for MP3 Uploads direct to Sound Cloud. To avoid having to first upload a large file to my server and push to Sound Cloud, I'm hitting their API directly via SWFUpload, passing necessary OAuth token data.
Everything works - EXCEPT - Flash can't handle the HTTP response code that Sou...
Hi all,
I have a custom component with textbox & a poup button
as
<mx:HBox>
<mx:Text id="source" height="100%" width="40%" data="my text" />
<mx:VBox backgroundAlpha="0" height="100%" borderThickness="0">
<mx:PopUpButton enabled="true" id="editButton" width="40" icon="@Embed('assets/images/Legends/editIcon.png')"
...
I have this DataGrid:
<mx:DataGrid id="myDataGrid">
<mx:columns>
<mx:DataGridColumn dataField="colA" headerText="Column A:" width="40"
headerRenderer="path.customComponents.VerticalHeader"
itemRenderer="path.customComponents.CustomDataGridItemRenderer" />
</mx:Columns>
</mx:DataGrid>
Only I don'...
I'm having a problem when streaming video. Randomly the video isnt shown, the video is playing though as the playhead moves and audio sounds.
It's strange though because if I press pause then play the video appears and also if I make it fullscreen it appears.
private var videoURL:String = "filename.f4v";
private function setupConnecti...
I have an ArrayCollection with values predefined. I want to assign a new value to items in the arrayCollection but can not figure out how. Basically I want to do something like this: acGuages.itemUpdated(0).thevalue = 90; (Changing the value from 25 to 90). Thanks.
private var arrayGuages:Array=[
{thevalue:"25",height:"115"},...
The movieclip is in a seperate swf file that has been imported into the library. The movieclip itself plays fine (the movieclip is vector based) but when I try and capture the current frame from it into a bitmapdata object nothing seems to happen. I'm wondering if it's some type of security issue?
mc is the movieclip
bitmap=new BitmapDa...
I am having trouble with memory allocation during a stress/performance testing of a program. In the test, I tried to do loading/unloading same set of resources again and again. The error I got was "Error, #1000, out of memory". The stack trace was about URLLoader/onComplete and URLStream/readBytes. I checked the memory being used at the ...
I have noticed that my AS2 swf that I load into an AS3 swf with SWFBridge sometimes doesnt load. I have usually loaded the page several times and it works fine then sometimes it does not load. When I quit Safari and restart it it will work again. I havent noticed this happening on a Windows PC but only on Macbook OSX in both Safari and M...
EVENT.DEACTIVATE doesn't work with safari in mac, is there any possible way to do this. (MouseEvent.MOUSE_LEAVE is not the same as detect when user lost the focus of the window) so I ran out of alternatives.
...
How to create multiple processes in Adobe Air program? Docs? Tuts? Algorithms? (for ex I have some design logic and some services client logic i want to run them in separate processes) (Air 2.0 is ok for me)
...
Hi
I would like to tint a movieclip with the tweener class.
This is how I tint the mc without the tween:
var c:Color=new Color();
c.setTint(0xff0000, 0.8);
clouds.transform.colorTransform=c;
it works but I would like to give it a smooth transition that's why I would use tweener.
Anyone have an idea?
...
So I'm currently making a platformer game in flash. I want to detect a collision between my player class, and the enemy class. The enemy class is inside of a class called ground. I tried to detect it using hitTestPoint (ground.enemy.hitTestPoint(player.x, player.y, true)), but to no avail. How would I go about doing this?
...
I thought that AS3 now has private abilities added. So why should I still preface private variables with an underscore?
private var _privVar:String;
...
I have a AS3 swf that scrapes google images for a search query and displays some of the results. It works locally, but when the swf is on a server it can't access google. I've tried Security.allowDomain, but it doesn't work. Any suggestions?
...