actionscript-3

Font metrics in Flash/AS3

I have a project coming up where I'll be rendering text paths on a circle; the text has to be dynamic, so I can't just bring in a precomputed set from illustrator. Now, laying text on a circle ought not be too hard, I'll do it per character with per character rotation. The trouble is, I can't seem to figure out how to get per-character ...

Connecting to commercial databases from an Adobe AIR application

I'm new to Flex and Adobe AIR, but I'm writing a desktop application that will need to connect and query commercial databases such as DB2, SQL Server and Oracle. How do I connect to these type of databases from ActionScript in an AIR application? ...

Papervision3D: Making a camera look at Plane

I have a wall of Planes at different angles and positions. I'd like to get the camera to rotate and look straight at the focused plane. I have created a dummy Plane (lookAtMe) that tweens to the Plane I click on as follows: private function planeClicked(e:InteractiveScene3DEvent):void { lookAtTarget.copyTransform(this);...

[Flash] How to change the color of a movieClip?

Happy New Year 2010 everyone :) Just getting back into the Flash groove, and having a simple question. I have a movie(video player) where the color of the buttons changes. I've already drawn out the buttons and created a 1 color box(movieClip) that will be the background of all the buttons. I've used ColorTransform to change the color ...

Bug? LoaderInfo getLoaderInfoByDefinition security sandbox violation in AIR

This question is specific to Adobe AIR ActionScript/Flash applications. I've spend quite some time researching this and kept finding discussions about either the Flash Player security model when running in the browser, where issues with SWF loading can be mitigated in various ways (loading from the same domain, using a crossdomain.xml fi...

setting up frame by frame menu navigation vs. All Code

I am All Programmer when it comes to anything including flash. I got into making games not to long ago and some people use frames to navigate from the main menu to the game screen and so on (which I have no idea how to do). and some people encapsulate the game inside of a class and call it from the document class and add and remove it wh...

How can I reference only a portion of a TextArea's htmlText block?

I have a number of very poor-quality pdf documents that look like 80's photocopies, which I'm rebuilding in Flash (Flex Builder 3 MXML application), representing paragraphs of text in TextAreas so that selected portions can be bold or italic, or whatever I need. I need a way to apply toolTips or event listeners to individual words withi...

Dynamic Object Initiation As3

I notice in older version of flash you can create an instance of a dynamic class. I am creating a game that will have many different classes that can be displayed on the stage but can very from time to time. How would I go about calling them dynamically. for example var newObject = new ["DynamicObject"](); ?? Is this possible in As3...

AS3: Math-related - Constructing Equilateral Triangle

Hi there, I am trying to construct an equilateral triangle with the following code, but I am not seeing what I would expect to. I would expect to see a triangle drawn to the stage, but I don't see one. I think there must be something wrong in terms of the location of the tri sprite on the screen. public class test_drawing_triangle exten...

Stage shifts when using addChild?

I'm having a very odd bug with ActionScript 3 in Flash CS4. I am adding movie clips to a stage in a for loop and then moving them out of view so that I can pull them in and remove them when I need them. I've narrowed down the issue to a point that I know that every time one of the movie clips are added to the stage using addChild(), th...

How to check the mouse is over something clickable?

I'm building a specialized viewer application which loads external SWFs. var content:Sprite = ... content.addChild(loader); I listen to my top level content Sprite MOUSE_OVER and MOUSE_OUT events. The over handler hides default cursor and displays a custom (zoom) cursor. Out handler changes cursor back to default. What I want to achi...

1178: Attempted access of inaccessible property left through a reference with static type

I am trying to override a parent class method. I successfully done so. But when I try to access a property. i get the following error 1178: Attempted access of inaccessible property left through a reference with static type This property is public and it is defined. below is my code package com.objects { import flash.display.MovieCl...

How can I copy a masked bitmap maintaining the masking transparency in actionscript?

Hi all - I need to find a way to copy a masked bitmap. I have a bitmap on stage, and a user drawn sprite that acts as a mask. I need to capture/copy the masked area bitmap, maintaining the transparency created by the masking to eventually encode as a png. I could find no documentation on how to accomplish this using copyPixels(), or an...

Flash. Prevent mouse drag on child

Hi, I have a movieclip with a child button in it. The movieclip can be dragged and dropped. I want to disable dragging and dropping of the movieclip when I press/drag on the child button. mouseChildren=false and mouseEnable=false don't work, since I want to keep my mouse events for the button. --------------------------------- | Movie...

How to get a file generated by SWF from URL?

so I have a SWF file. It can generate Jpeg images. I want to get that images by url (for ex www.my.com/file.swf#image.jpeg) I want to get just clean image (no flash no sign of flash). So as if i was just calling my apache server to give me that image. So how to do such sing with AS? I need Libs Tutorials or anething. ...

User input in datagrid with custom component

Hi guys and girls, I Would like to narrow down my problem as follows: 1) I have a datagrid where one of the columns is rendered using a symbol containing an input text control as well as a static text control which looks almost like this: [],000 (where '[]' implies the input textbox. 2) my cell renderer renders the column correctly. I...

Casting a subclass into a parent variable as3

Hi all! I am calling on different types classes from within a loop. The objects can be of different types so therefore I am using the getDefinitionByName method. here is a piece of my code: for(var y = 0; y < mapH; y++) { brickHolder[y] = new Array(); for(var x = 0; x < mapW; x++) ...

Nested Functions, how are they garbage collected in flash actionscript 3?

Hi, I have a very complex function in as3. The function is composed of many other functions which are nested inside of it. The main function has variables and all it's nested functions also have their own variables. Some of the nested functions are called by events that were added in the main function or in another nested function. Now...

How do I access a MovieClip on the stage from the Document Class?

I have a "box_mc" movieclip on the root of my stage and I need to select it from within my Document Class. I thought Stage.getChildByName("box_mc") would work, but it just returns null. Thanks in advance. ...

[as3] denied due to lack of policy file permissions

I can't get my Yahoo! Application Platform to run I keep getting denied access even though their policy file accepts requests from any domain. OK: Policy file accepted: http://social.yahooapis.com/crossdomain.xml Error: Request for resource at http://social.yahooapis.com/v1/user/&lt;user id>/profile?oauth_signature_method=HMAC-SHA1&lang...