actionscript-3

Flex: How to embed fonts with CSS

Hello, I have two questions: I am trying to embed fonts via this page in the livedocs. Can anyone tell me what I need to do to use an external style sheet? Should it be a style sheet or an mxml file? I saw this tutorial, which offers quite a bit of good information (some of which I also found in the livedocs) via the comments. EDIT...

Detecting the NAMES (not values!) of the attributes of an XML node in flex/as3

var node:XML; In flex/actionscript 3, I can call node.attribute("somename") and get the value of the "somename" atribute of the node. I can also call node.attributes() and get the VALUES of ALL the attributes. But how the heck do I know what attributes to look for?! The application I am creating does not know the format of the XML fi...

Flash: Stage.FullscreenInteractive -> Difference if class or 1st frame

hello, i don't get it! example 1: 1st frame of my app var screenBounds = Screen.mainScreen.bounds; //Bounds of current screen var full:Sprite = new Sprite(); //Sprite Fullscreen //Enter Fullscreen function goFullScreen(e:Event = null) { //myClass.goFullscreen(); full.graphics.clear(); full.graphics.beginFill(0x...

Why are animations sometimes done using steps based on the amount of time that's passed?

I've noticed that some programmers animate objects based on the difference in time. I am not sure why or even if this is logical. Does anyone know the significance? Below is a snippet of code that explains what I mean: var timePassed:int = getTimer()-lastTime; lastTime += timePassed; var newBallX = ball.x + ballDX*timePassed; var newB...

Flex access of undefined property EVENT

I am working in Flex Builder 3 and I am trying to figure out this error. The error console reads "Access of undefined property EVENT." I am not understanding why this error is showing when I have already imported flash.events.Event. Flex is not recognizing with even the hinting helper pop up that appears when I type the addEventListene...

AS3: MOUSE_OUT not firing when Mouse leaves stage

I am developing a website with nav items that cover the whole stage from top to bottom (see altered image below) and it is pretty easy for the user to exit the stage with their mouse, not triggering the MouseEvent.MOUSE_OUT events required to "turn off" said nav items. Should I be using Event.MOUSE_LEAVE to detect when the mouse has lef...

Usage of custom event with properties... Multiple events and single listener

Hi there, I am having a hard time wrapping my head around what to do for the following situation: I have multiple items in my app that I would like the user to click on. Some items are completely different classes. The classes dispatch events and then when the events are captured, some modifications are done to the transform proper...

Prevent displaying of some data in last row of Flex Datagrid

Hello! I have some DataGrid with editable rows, which has also an option to add new row 'dynamically'. I mean, last row has some default data (e.g. "CLICK HERE TO ADD NEW ROW") and when user clicks on it, he can edit that value and new row will be eventually inserted. However, I also have a column in same DataGrid which doesn't come fro...

getting an area of a object

I am trying to get the four corners of my object. To test out whether its accurate enough. use a method to trace a message when my mouse passes the objects bottom, left, right, or top. when the object is positioned at coord 0,0. it works perfect. but when I reposition it. It becomes off and I have no idea why. here is my code. in my cla...

Display objects not aligning correctly

I am aligning my display objects in the middle. stage.stageWidth/2. for some reason, they are aligning further off to the right of the screen. I haven't altered anything but the stage width in flash. Has anyone heard of this problem? Again, I haven't done anything except widen the screen and adjust the height. Here is the code I trie...

overriding subclasses in actionscript

Trying to find a straight answer for this. I am going to be creating some sub classes in actionscript 3. I was wanting to know if it is possible to override the parent class. If so, do I need to put a override assigner on the parent class method or what. Thanks guys ...

Finding out coordinates of drawn objects in Flash AS3

I'm in the process of making a board game in Flash; as part of process of getting fully to grips with Flash AS3. I have a JPEG of the original board. This contains ~ 1000 circles that players may move pieces between. Pretty standard board-game stuff. The circles are not in any way regularly spaced. So far, I've drawn the circles in Fla...

AS3 create component using Flash CS4

I would like to create a basic component consisting of a textbox and a label next to it (in other words an InputText and a StaticText). I only need to set and get the text in the Input textbox, the static text will stay as is. Any help would be highly appreciated! Jasco ...

remove a listener that has an anonymous function in Actionscript 3

up.addEventListener(MouseEvent.CLICK, function clickFunc(event:MouseEvent):void { revealSpinner(event,51.42,1,spinner); event.currentTarget.removeEventListener(event.type, arguments.callee); autoTimer.stop(); }, false, 0, true); down.addEventListener(MouseEvent.CLICK, function clickFunc(even...

Load an external swf file into SpriteVisualElement always return the same DisplayObject

code looks like: <fx:Script> <![CDATA[ private var role:DisplayObject; protected function btnAdd_clickHandler(event:MouseEvent):void { for(var i:int=0;i<10;i++){ var dis:DisplayObject = this.main.addChild(this.role); dis.x = i+10; dis.y = 400; ...

Scrollpane - allow scrollDrag when clicking anywhere inside the pane?

I am using a ScrollPane that I want users to be able to scroll by clicking andywhere inside it. I have set up the pane like this: scrollDrag = true; verticalScrollPolicy = ScrollPolicy.OFF; source = someMovieClip; addEventListener(ScrollEvent.SCROLL, sidePaneVerticalScrollHandler); I go on to show a few different SWFs on the s...

Flex e4x - select by multiple attributes

<EFM> <projects> <project name="EFM Columbus Supply Chain Project"> <characteristics> <characteristic name="Types of Data"> <textDescription></textDescription> <options> <option name="Commodity Flow" value="True"/> ...

Datagrid Cell render with custom component

A few hours ago I've asked how to create a custom component (textInput and label component and created a Component Definition) and with your answers I can do that now. Problem 2: I'd like to use that component in a datagrid column so that the user can type a value in the textInput which will in turn update the underlying dataprovider. I...

Infinite tweening hue loop in AS3 with Tweener.

Hi, I'm trying to infinitely loop a bitmap all the way through the colour spectrum using AS3, Tweener and its ColorShortcuts class. This doesn't loop back to the function "tween1": function tween1():void { Tweener.addTween(image, { _hue: 180, time:5, onComplete:tween2 } ); } function tween2():void { Tweener.addTween(image, { ...

Flash/Actionscript 3: When does flash stop rendering and how to keep active?

I have a flash/Actionscript 3 application (swf). This application sends a message to a server every 2 seconds. However, in some browsers/operating systems (for example, safari in mac), the moment the browser loses focus, it stops sending these messages. I send these messages in a EVENT.ENTER_FRAME loop, so every time the application is ...