actionscript

Actionscript base class in Flex AIR app

I'm trying to build a Flex AIR app using Flex Builder 3, which I'm just getting started with. In Flash CS4, there's a text field in the authoring environment where you can specify a class that will become the "base" class - your class inherits from Sprite and then "becomes" the Stage at runtime. Is there a a way to do the same thing wit...

Adding Spark button in ActionScript project

Hello, I have a button skin in spark created in Catalyst. Now I want to apply this skin to my project of type ActionScript project. When I add a simple spark button to my sprite then it's not showing there. Can anyone help me to figure out how to add a Spark.Button in a Sprite? Best Regards ...

Settings for RTMP and AS 3.0

Hi, Is there any extra code need for using rtmp with AS3. I have the code like this. Is that enough for rtmp or any other code needed? var strSource:String = "rtmp://myserver.com/file.flv"; var ncConnection = new NetConnection(); var nsStream = new NetStream(ncConnection); nsStream.play(strSource); ...

Soft Paint Bucket Fill: Colour Equality

I'm making a small app where children can fill preset illustrations with colours. I've succesfully implemented an MS-paint style paint bucket using the flood fill argorithm. However, near the edges of image elements pixels are left unfilled, because the lines are anti-aliased. This is because the current condition on whether to fill is c...

In Flex Builder, what's the shortcut key to switch perspective?

Hi anyone know? In Flex Builder, what's the shortcut key to switch perspective? ...

AS3: why is this happening?

Hi, I just encounter a strange problem: var a:ClassA = new ClassA; var b:ClassA = a; The program keeps running sometime, the a = null, b = null. The program is a complex one, I am sure that no part will touch a, and b. My question is, will the runtime(garbage collector) to collect the memory of "a" and then assign a and b to null? ...

disable GC in AS3

Hi, I met a strange problem in AS3 and thought the problem may be caused by the GC, can I disable GC explicitly in AS3? Thanks. Bin ...

How can I make an AdvancedDataGrid re-display its labels when the results of the labelFunction change?

I have an AdvancedDataGrid with a custom label function whose value can change based on other form status (specifically, there's a drop down to choose the time display format for some columns). Right now, I have this labelFunction: internal function formatColumnTime(item: Object, column: AdvancedDataGridColumn): String { var second...

Intercept a request to read a particular file and instead generate the apparent output of that file read programatically

Sorry for the long and yet still somehow vague title! A friend of mine has a Flash Action script running on a LAMP server that currently reads an xml config file. He's asked me if it's possible to remove the xml file, and replace it somehow with a system (lets call it an 'auto xml generator') that intercepts the request to read that fil...

Animation with Initial Velocity

I've been trying to solve this problem for a number of days now but I must be missing something. Known Variables: vi = Initial Velocity t = Animation Duration d = Distance. end velocity should always be zero The function I'm trying to create: D(0...t) = the current distance for a given time Using this information I want to be able to ...

AS3 and hashing

Is it possible to hash flv videos so it is unplayable by itself and the format is unrecognizable by softwares, but i could actually de-hash them and play in my as3 script? This is going to be realized on a CD so I can't use server scripts. ...

build a nested structure from a sql query

I have a table in sqlite that I am accessing in my Adobe Air project. The table structure is as follows: id, chapter_num, verse_num, translation_id, translation_txt; I want to write a query that returns me one row per chapter_num and verse_num with a nested structure of translation ids and translation_txt under it. For example, I wan...

Calling WCF Service from Action Script 2

Hi All, I am a .NET programmer working with a Flash designer on a project. The design is that they will create a flash UI (implemented with AS2) to present a questionnaire. After it is completed by an end user, the will send me (a .net web service of some form) the answers to the questionnaire, I will perform a calculation, and I will...

Is there any Good opensource not C\C++ library for playing with FLV container?

Is there any Good opensource not C\C++ library for playing with FLV conteider? So I need it in AS3 but Java or C# will be fine=) I need to be able to put in flv audio track andsome bitmaps (with some exact timestamps relativly to my audio track) So Is there ay or I have to implement all bymy self just reading spetificatiopon? ...

Rendering MXML component only after actionscript is finished

In my mxml file, I'm doing some calculations in the script tag, and binding them to a custom component. <fx:Script> <![CDATA[ [Bindable] public var calc1:Number; [Bindable] public var calc2:Number; private function init():void { calc1 = //calculation; calc2 = //calculation; ...

How do I store keys pressed

I would like to store keys pressed when I listen out for the keyDown on the stage. I can add the listener fine, but I'm not getting the character I want out of the event to store it into a string. This is what I have so far: private var _addToString:String = ""; public function Hotwire() { this.addEventListener(Keyb...

Creating an intro followed by a loop

Hey everybody, I just recorded some song and cut it into two parts. The first part contains an intro and the second is supposed to loop. What I want to do now, is to have a simple graphical animation (5 keyframes or so) that loops as well, while the music plays along. There's probably a simple solution to it, when you're familiar with ...

mouse wheel operates on scrollbar

If a SWF file or even a component within it has scrollbars, wouldn't it make sense that if the user is hovered over that area (it's in focus) and uses the mouse wheel, that this movement would automatically translate to the scrollbar moving. Any ideas how this is done, the events or classes used for this? I'm open to outside components ...

Flex Framework vs. Micro-Architecture

I'm in the process of choosing a framework for my flex development, and one of the questions that was asked about a framework was "is this a framework or a micro-architecture"? Can someone clarify what's the difference? What exactly is a framework, and when can we start calling what we have a framework? I work with FlexBuilder3 (now c...

adding a sprite to 1 <s:State>

I'm looking for a flex 4 compatible way of adding a sprite generated with graphics library to a skin. If I generate the sprite like this: private function drawShape():void { theshape = new Sprite(); theshape.graphics.beginFill(0x666666); theshape.graphics.drawCircle(3,5,10); theshape.graphics.endFill(); } What would be t...