actionscript-3

Flash as3 trigger click

So I am working on a project in which I need to trigger a click event. However, its a little more complicated then just that. I know how to dispatch an event by doing btn.dispatchEvent(), but the problem is I dont know which button it will be. Basically I am creating a wheel that spins. I need to trigger the click event of the element th...

Why I cant set the position in this code (AS3)?

Hi guys, First of all, I am new to AS3. What I am trying to do is to make the ball, rotate in circular form. This is my current code: this is the Circular.as public class Circular extends Sprite { private var ball:Ball; private var centerX:Number = stage.stageWidth / 2; private var centerY:Number = stage.stageHeight / 2; ...

ActionScript compiler

Hello, are there any compilers for ActionScript 3 under *nix like systems or appropriate toolkit to work with Flash? ...

Flash, using Event.ENTER_FRAME or movieclip?

I want to create an endless loop, 8 items moving in a circular shape. When you roll over of each item, it will stop the moving, and you should be able to click it. I dont know what should I use, should I use Event.ENTER_FRAME or the circular shape should be in movie clip, so that when there is a mouse over event, it will stop moving? I ...

Flex compile problem with as3httpclient

Hi, I am having trouble getting a Flex application (with as3httpclient) to work. I compiled it (compc -load-config=build-swc.xml), put the as3httpclientlib-1_0_6.swc in my libs dir, and ran mxmlc -compiler.include-libraries lib/as3crypto-1_3_patched.swc lib/as3httpclientlib-1_0_6.swc lib/corelib.swc -- App.mxml In my actionscript I ...

Very compact object serialization method

I'm building a realtime action multiplayer game in Flash which is using too much bandwidth because it sends message objects as XML (as required by the Smartfox server). I'm now trying to cut down on that by serializing my objects to strings before feeding them to Smartfox. I've tried JSON but it doesn't help much. Is there another seria...

Representing relational tables in ActionScript 3.0

I'm struggling to make a flexible data structure (like a relational database) for a quiz in ActionScript 3.0. I have a number of questions, each with 2 alternatives: Questions | id | alt1 | alt2 | correctAlt | --------------------------------------- | 0 | Sweden | Denmark | 1 | | 1 | Norway | Finland | 2 |...

Only in Internet Explorer, Flex 4 PrintJob gives Error #2057

I am having an issue with printing with the PrintJob class in Flex 4. Basically it should print 3 pages, each with a colored square. It works for me in Chrome and Firefox, but if I test it in IE I get the following error: Error: Error #2057: The page could not be added to the print job. at Error$/throwError() at flash.printin...

AS3 trace w/out newline

For diagnostic purposes, I want to print a matrix (an array of arrays). To do this with a loop means executing a trace command multiple times, whichto my understandingprecludes the possibility of printing multiple table cells to a single row. (When coding trace(x); trace(y);, a line break falls between x and y.) What can I do? ...

Switching flash scenes within a MovieClip

For the downrankers: I have searched this question in the internet and found countless posts. But neither worked because of a small problem here or there, and when I though of posting my problems in the same thread I realized its a month/year/millennium old. So I'm gonna ask here. For other people: How do I switch scenes within a flas...

How do I pass a click event along to other children below in actionscript?

One of my decoration bitmaps covers up some important elements in my flex application. The problem is these elements become not clickable. How could make the bitmap not clickable or how could I pass the click event along to those children elements below? ...

flex 4 title window + custom component + skin problem!

I'm trying to put my components in a window container that can be closed by "x" moved on the stage, resized and so on. And I wonder which is the best way to do it. I want to use a skin class and the component class. The "solution" that is not working looks like this: take a look at this and if you have a better idea on how to implement ...

AS3 - Manually created MovieClips and 'Convert into compiled clip' trouble

Hi I want to use compiled clips to speed up compilation. But I've found following problem: I've got Foo class, which extends MovieClip and is set as 'Class' to one of library's symbol (this symbol is also called Foo). This symbol (Foo) has a MovieClip child, whose instance name is FOO_CHILD. I'm referencing this child inside Foo clas...

MovieClip inheritance error in flash

I have a class named Level which inherits MovieClip. Level has a child in the designer with the name gridView and the gridView is used in Level constructor. I have also class named Level1 which inherits Level. when I try something like addChild(new Level1()) I get error in Level constructor saying gridView is null. What am I doing wrong?...

Does setting setting movieclip.visible = true each frame use any extra resources?

If something is visible, does calling movieclipname.visible = true; each frame do anything performance wise? ...

How do I find the bounding rectangle of a LinkElement in a Flex4 TextFlow?

The link elements I'm talking about are single words, so they are not wrapped inside the container, which means that they should have a single bounding rectangle. But how do I go about finding this rectangle? I'm familiar with Flex3 but don't know enough about the new Text Layout Engine in Flex4. Can someone help me please? Thanks! ...

AS3 Preloading Issue

Anyone out there can help me with this? I am facing some problem on preloading swf in Chrome and IE. It only works in Firefox. When i preload flash, Iam getting bytesTotal as 0. So when i bytesLoaded divide by bytesTotal will cause infinity. I read this article on GZIP. http://patrickmcd.com/2009/04/20/flash-preloading-errors-turn-off...

Can I SEND messages via the underlying NetConnection of a receiving (playing) NetStream object?

Here's my problem: I have a NetConnection object connected to a server. On top I create a NetStream object and it started to play a file from the server. Classic so far. What I need now, is to be able to send some (short) messages back to the server, at various moments during playtime but, clearly, using the existing TCP connection. Fr...

Overriding public method in dynamically loaded class with AS3 and getDefinitionByName()

I have two SWFs: main.swf and external.swf. main.swf needs to access some methods in external.swf, so it loads external.swf into itself and uses getDefinitionByName("package.Class") to access the class and one of its methods: var ExternalClass = getDefinitionByName("package.Class") as Class; var ClassInstance = new ExternalClass(); var...

Fastest way to get an Objects values in as3.

Ok, so I swear this question should be all over the place, but its not. I have a value object, inside are lots of getters/setters. It is not a dynamic class. And I desperately need to search an ArrayCollection filled with them. The search spans all fields, so and there are about 13 different types of VOs I'll be doing this with. I've t...