actionscript-3

Changing order of font managers when compiling via ANT task, not possible?

I've recently had the need to use the managers compiler argument, because the project had an Open Type font embedded, and was generating errors at compilation. Now I need to use the same argument in my ant task, but for some reason it doesn't work. I'm using Flex SDK 3.2. The task looks something like: <mxmlc file="${main....

Compiling a flex application with services-config.xml, with an unknown context.root

I would like to compile my flex application with a services-config.xml file. However, I am forced to supply a context.root. In my setup, the context root (context path) isn't known until my .war file is named and dropped into the webapps directory. It seems like there has to be a way to do this, but I haven't been able to come up with ...

Fundamental binding issue

Hi guys, I just ran into a strange binding problem. In the mini app below, the Flex Label component is updated when 'someText' changes, but my boundSetter won't be called after the first, initial call. In short: Why is the boundSetterForSomeText() function not called, while the label does update? Could anybody please shed some light o...

ActionScript 3 code folding/regions

Is there any way to create foldable regions of code in ActionScript 3 (read this as Adobe Flash CS3 built-in editor). I'm looking for something like in MS Visual studio so that I can do: #region "Event handlers" ... big list with methods here #end region Any ideas? ...

Fit TitleWindow to contents

If I don't specify width and height values for a TitleWindow, it will be resized to fit it's contents when I show it using PopUpManager. But there are moments when some components inside will be resized, like a ComboBox which dataProvider is loaded asynchronously, or another component which was not visible and I'd like to set it's inclu...

Issue with flash room editor and large number of images loaded in

I created a Flash room editor for an online game. The user is able to add items to their room, which the flash loads in and creates an object for each item. For the average user this works great, but I have run across a case where a user has added 8400 items to a room and the flash can't handle it. The XML file loads up fine, but noth...

Binding to an specific property of objects in an array

I am using Flex to create a small form. All I have at the moment is a List component, that I want to populate with a list of font names. I am getting the fonts using Font.enumerateFonts(true);. This returns an array of flash.text.Font objects. The Font objects have a fontName property that is a String of that fonts name. My problem is...

AS3: ByteArray and BitmapData

I'm doing a simple test. I want to write BitmapData into a ByteArray. I'm trying to do this with writeObject() and readObject(). Read object seems to have trouble making sense of the BitmapData. var byteArray : ByteArray = new ByteArray(); var _cache : BitmapData = new BitmapData( 640, 480, true, 0x000000 ); var _blank : BitmapData = ne...

AS3 StartDrag() Not working in OSX

I wrote some very simple code to replace the mouse Cursor in a flash application I am writing in AS3/FlexSDK. The code: var cursor:MovieClip = new Cursor_addElement(); canvas.addChild(cursor); cursor.startDrag(true); It works perfectly fine on XP and 2x Vista machines, but on OSX the cursor does not follow along with the mouse - it j...

Flaky Flash buttons

I'm working on this Flash project done with AS3 and for some reason the buttons I've created aren't always responding to clicks. Sometimes I need to click two or three times before the actual click comes through. Has anyone experienced similar issues? ...

How to programmatically drag and drop a Sprite in Flex?

I need some actionscript code to simulate the dragging and dropping of a Sprite, I was wondering if it is possible to do so? if it is how? For example to simulate a click on a Sprite I can achieve with the following line of code. sprite.dispatchEvent(new MouseEvent(MouseEvent.CLICK)); ...

viewstacks vs states in flex ?

I have an app that I am currently using a viewstack to display each page and I am wondering is this the right way to go, or should I use different states (or something else). The site is powered by a menu bar with the top level items of Home, Tools, Support. Underneath the Tools menu is a submenu with Tool1, Tool2, Tool3. Currently when...

Binding combobox with object array ???

Hi, how to bind array object to combo box in Air application.. i have array of objects from that i need to bind name property to the label field of combobox how to do that ? var objk:Array=objkparent.children; // it return object collection comboBox.dataProvider=objk; comboBox.labelField=objk.name; but its not working how to bind...

How can you keep focus and cursor in Flex's TextInput after hitting enter ?

I am a Flex newbie and I am testing a little application that simulates a cart. (It is based on a nice sample by Farata Systems' Yakov Fain). Note: I am using the beta of Flash Builder 4 to code the application. Here you have a link to the screenshot: Screenshot (Sorry I can't insert the image of the screenshot right here since stackov...

Mouse pointer angle with MovieClip in AS3

Hello, How can I calculate the angle of a point the Y-axis (say, the Y position of a MovieClip) with the mouse pointer location in Actionscript 3? Many thnx! ...

group rollover effects with actionscript3

I've got the following issue with a actionscript3 project. I have a group of buttons setup via a class sitting in a holder sprite. When I rollover one of these buttons I loop through all the buttons in the holder and run tweenlite to tween the alpha to .4 except when the name matches the currently active button. When I rollout I reset...

What's more efficient: a Timer, an EnterFrame event or a basic tween with extra code?

Greetings. I'm building a video player in ActionScript 3, that's supposed to be targeted on performance. It has to play large h264 videos via RTMP, with the least possible processor load. There's not much control on the actual video playback part, but my approach is to try and not kill the processor with the chrome and other additional ...

How do you make a SWF resize inside a HTML page?

Hey, again. The stageHeight and stageWidth are read-write properties of the Stage class. Is there any way to embed the swf so that when you set them to a different value, this is reflected in the HTML page? Possibly without calling a JS function via ExternalInterface to modify the embed's parameters? The main idea is that I don't know...

Check Folder as Write access,Air app ,Flex

hi, how to know the folder as write permission in air application..in my application i am saving txt file in folder,so that i need to test that folder as write permission... var file:File = File.desktopDirectory.resolvePath("TxtFolder/DataFile.txt"); i need to check "TxtFolder" has write permission...? before saving the file(DataFil...

Flash CS4 Textfield weirdness!

I've been working on a flash project where a designer has included a typewriter effect. The effect was working for the best part of a day, and now with some minor changes to other parts of the fla, it's not working!! Does anyone have any ideas why this doesn't work.... import flash.text.TextField; var phrase_string:String="SALE IS E...