actionscript-3

Dynamic stageWidth and Height in Flash AS3

This seems like it would be a really easy thing to do, but its been giving me all kinds of headaches. I have a movieclip that is a gallery, It's linked to be called from AS when a button is clicked. When an image in the gallery is clicked, It fades in using the Tween class and is supposed to be centered in the main stage, but its cente...

Do you know about NativeApplication.nativeApplication.icon,bitmaps in flex ( action script3 ) ?

NativeApplication.nativeApplication.icon.bitmaps = bitmapData(); I wrote coding in my project for sysTrayIcon display but got error like NativeApplication.nativeApplicationSeverity and Description Path Resource Implicit coercion of a value of type flash.display:BitmapData to an unrelated type Array. toy/src toy.mxml .icon.bitmap...

AIR application, set cursor position in form

I have an AIR application with a login form. What I want to do is set the cursor in the first textinput box. I only manage to set the focus on the box, but not the cursor. Does anyone have an idea for how I can do this? ...

Actionscript 3 timeline access not working

In frame 1 of a very simple flash file, I have the following code: stop(); this.addEventListener(MouseEvent.CLICK, function(e) { gotoAndStop(5); }); gotoAndStop(10); When I run the flash file, I expect that it would automatically step to frame 5 (ED. we think he means frame 10), but it does not. However, clicking anywhere does cause i...

How much interacting can i get with the GPU with Flash CS4?

Hi All, as many of you most likly know Flash CS4 intergrates with the GPU. My question to you is, is there a way that you can make all of your rendering execute on the GPU or can i not get that much access. The reason i ask is with regards to Flash 3D nearly all existing engines are software renderers. However, i would like to work on ...

Flex: How do I space out items in a HorizontalList control (using a custom ItemRenderer)

I have a HorizontalList control that uses a custom ItemRenderer to represent each item as a toggle-button. The list allows drag and drop, and I used this method to rotate the drop feedback (line) into a vertical position instead of horizontal, but with the buttons mashed together, the drop feedback is pretty subtle. I'd like to space out...

Actionscript 3.0 Best Option for Subclassing Vector Class (Flash Player 10)

I would like to take advantage of all the goodness of the newer Vector class for FP10, but it seems it is marked as final. I am doing some intensive mathematical processing in Actionscript, and repeatedly process arrays of Numbers. I have previously been using my own subclass of Array(I call it NumericArray), with added functions such a...

Flex/AS3 Problem listening to an event dispatched from a Singleton Class

I have a singleton class for global access to config information. This singleton class called ConfigurationData extends EventDispatcher. Here is the class (note that I left some things out like variable declarations to keep this short): /** * Dispatched when the config file has been loaded. */ [Event (name="configurationLoaded", type=...

How to create/use themes in a Flex project

I just started out with Flex, and while I have worked with Actionscript2 for a few years, I'm still getting my head around Actionscript3. I've been diving into Flex for the past week, and can't figure this one thing out. I am looking into the best way (or 'a' way) to allow me and other folks working on this project to easily create new ...

Do you know 1024 Overriding a function error on flex (flash )in action script 3?

In my project i used this below function public function createIconMenu():NativeMenu{ var iconMenu:NativeMenu = new NativeMenu(); iconMenu.addItem(new NativeMenuItem("", true));//Separator if(NativeApplication.supportsSystemTrayIcon){ iconMenu.addItem(showCommand); showCommand.addEventListener(Event.SELECT, onShowCommand)...

Preventing google maps Markers to "fly" up when dragged

Heya I'm using the Google Maps Flash API and I have a bullseye Marker that the user should drag to the correct position, but whenever you drag something it flies up a bit and this stupid target cross appears below, which is what I would like to prevent, because it doesn't look nice and I'd even say it's confusing. The only idea I have ...

how to store bitmaps into arrary in flex (action script3) ?

In my project i used image array with 16+16 32+32 48+48 128+128 different size of image for system tray icon but i put on bitmes then shows Error #2005: Parameter 0 is of the incorrect type. Should be type BitmapDat. public var imageURLs:Array = ['icon/toy.png','toy32.png','TOY48.png','joy128.png']; NativeApplication.nativeApplicatio...

What are the issues to be aware of when updating Flash 8 AS2 content for Flash 10

I have a large number of Flash projects that have been written in Flash 8 (AS2). I recently acquired Flash CS4 to update this content to the new version. I have some new functionality to add and want to take advantage of some new features in Flash 10 (local file access etc). I have already encountered a number of issues when opening my f...

AS3 odd or even (mal)function

please how to fix this AS3 function ? thank you function dispari(numero:int):Boolean; { //check if the number is odd or even if (numero % 2 == 0) { returns false; } else { returns true; } } ERROR: 1071: Syntax error: expected a definition keyword (such as function) after attribute returns, not false. ...

How do I load a MOV file into Flash 9

I am having issues loading an MOV file into Flash 9. When I google the question, I get alot of people say sure you can do it, but nobody provides working sample code. ...

Export animation sequence from Flash as JPEGs

I'm wondering if it's possible at all to sort of record/capture the state of an swf movie over a period of time and save it all down as jpgs to the server? AS3 has the new com.adobe.images.JPGEncoder class that seems to do the job, but can I capture a sequence? The hope would be that I could put it back together as a video or animation...

AS3: declaring an "undefined" parameter for int, uint or Number

I'd like to implement the following logic: function setMyValue (myVar:int = undefined):void { if (myVar == undefined) { /* Generate a value for myVar */ } else { /* Use the supplied value for myVar */ } } So if the value is supplied, use it. If not, generate it. Seems simple enough. Problem is that A...

Pass data between flex components

I'm new to flex , so forgive me if this is a dumb question. Right now I'm using custom events to pass data from one component to another. My problem is that events only bubble up. How can I pass data to a component that isn't a parent of the component dispatching the event? Here's the basic layout. I'm trying to get data from compone...

How do you work around the need to cast an interfaced object back to its base class?

This question is meant to apply to interfaces in general, but I'll use AS3/Flex for my language. It should be [mostly] obvious how to apply it in different languages. If I create a base class, and it extends an interface, there is an explicit contract defined: for every method in the interface, the base class must implement said method...

Is it possible to make FileReference.upload() block (In ActionScript 3.0)?

I am working on a Flash file upload widget, and I want it to upload one file at a time. In my upload function, I currently have a FileReferenceList, and I am looping through it, calling upload on each one. However, since FileReference.upload is non-blocking, all of the uploads are going simultaneously. Is it possible to make the uplao...