actionscript-3

Best way to dynamically load an xml configuration file into a Flex4/Flash movie at runtime?

I've got a rather simple question about loading in an xml file at runtime in a SWF. I've found a couple different methods to load in the xml. myXml.load("file.xml"); HTTPService object URLStream object What is better way to load an xml file that always has the same name and is located in the same folder as the SWF on the web serve...

Using the Real Time Messaging Protocol (RTMP) in Flash

Flash can use the RTMP protocol to exchange data between a server and a client. How do you typically access this functionality in AS2 or AS3/Flex? For example to use sockets you use the XMLSocket (AS2) or Socket (AS3) classes. Does the server-side RTMP software use Sockets under the covers? or is it HTTP with tunneling? The Real-T...

How can I dynamically change the width / position of a timeline-animated mask?

I've got a movieclip with two layers - a background movieclip, and above that, a mask movieclip (as you might guess, this layer is masking the first). Due to design necessity, the mask is animated on the timeline across 60 frames. The problem arises when I use an Event.RESIZE listener to change the width of the parent movieclip when th...

Whats the best way to calculate the bounding box around a group of DisplayObjects?

I have an array of Sprites on stage and want to now the rectangle that bounds them. I could do a loop and check each element's getBounds() but that could be computationally expensive. Is there a better way to do it? ...

FMS connection.closed solution?

I have a problem in as3 video player with fms connection time out as what the discussion is going.Please help me to solve this problem. its often connection getting closed. what i should do. ...

Flash buttons take focus off of screen

In my flash movie, every time when I click on a button, it takes focus off of the stage. And I have to reclick the stage in order to interact with it again. Is there away to fix this issue. I am making a game and it will be very annoying if the player has to keep reclicking the stage in order to take control of the game every time they c...

Reading Tiff files in Adobe Flex based Application

Hello all, can some one help me in reading TIFF files at runtime in Flex/AS3 based applications? Thanks for your time guys. ...

Flex + buffer + live stream via RTMP = disaster

Can't get any love anywhere on this and it's pretty hard to believe. Live streaming and a buffer on a NetStream do not mix. Why? The docs don't say you can't do this. The playback gets hosed. Buffer is supposed to fill to what you set it to before playing. Instead though, about half the time, the player starts playing right away an...

ActionScript -- How do u make sth move somewhere and move back?

Using Tween class maybe? I tried the easeOut. But if will write 2 Tween, the 2nd one will overwrite the 1st one, so I only see the obj moving in the 2nd Tween direction, not the 1st Tween direction. I know the coordinates for the 2nd Tween below is not correct (cos all coordinates shld follow the defined reference point), so I need to f...

Title Pop Up window slow movement

Hello flexers, I have a big flex app with several elements laying out (see http://www.edoboard.com) When i create Popup of TileWindow with PopUpManager they show up well but are slooww when dragged around. Even slower in the version i am working on. Do you have any idea why is it slow ? Even on simple examples http://blog.flexmonkeyp...

AS3 not accepting constructor

Ok, I have raise these question a thousand times and so far no ones been able to help me. I am raising again because I discovered something new. In the past I haven't been able to create parameters for class objects, every time when I do so I get the following error 1136: Incorrect number of arguments. Expected 0. I notice that my cl...

Hide ColumnSeries in Flex Chart

I have a clustered chart with 2 column series. The problem is that sometimes one column's values are so large, the other column is dwarfed. So I added checkboxes to show/hide a given column, and set the visibility of the ColumnSeries as such: visible="{checkbox.selected}" includeInLayout="{checkbox.selected}" This shows/hides the give...

Loadclip in AS2 file nested in an AS3 container fails.

I have an old AS2 project that needs to run in an AS3 container. When the AS2 swf is loaded, it communicates with the AS3 container using gskinner's SWFBridge. Once a connection is established, the AS2 file loads in all necessary xml data. When this is complete it calls a function that begins the process of loading external images. The f...

slowly rotate an object towards another object

I have an object that points in the direction of another object (i.e. it rotates to the direction that the second objects x and y coordinates are at) below is the code I use. var distx = target.x - x; var disty = target.y - y; var angle:Number = Math.atan2(disty, distx); var vx:Number = Math.cos(angle) * cspeed; var vy:Number = Math....

Fill an HBox in from the right? VBox from the bottom?

I only really need the HBox answer but figure that if we get a good answer in here it would help anyone trying to do a similar thing with a VBox. It would be nice to know this in both actionscript and MXML. So I have an HBox that I want some text aligned from the left and some radios from the right. Like so: __________________________...

Getting 2D screen coordinates of a 3D object in Papervision 2.0

How do I get the 2D screen coordinates of a 3D object when using Papervision 2.0 (Great White)? I've read that following properties should return the screen coords but these always return 0. myDisplayObject3D.screen.x myDisplayObject3D.screen.y I've also tried setting: myDisplayObject3D.autoCalcScreenCoords = true; But this has no ...

How to link library symbols in Flash CS4 to base classes from an external .swc (rsl)?

Hi all, This question stems from this question that I asked yesterday. I've followed Theo's advice and created a .swc with all the common classes and added the .swc as an external library to my module .swf. This all seems to have worked smoothly--I don't get TypeErrors and my classes are all present in the catalog.xml of the .swc file w...

outputting an array of links, with no overlapping!

When outputting links dynamically, I cannot determine the Y-Pos dynamically. It will work find if my links are single lined. link_txt.y = i*20; this will only work if the links are Single Lined. assuming they are 15px for height + 5 for spacing. As soon as they are 2 lines, they overlap. I've tried different methods but unable to figu...

How can I accurately draw my rotated bitmap?

Hi - I have a container with masked bitmap in it. The scale and rotation of this container changes at runtime, and I need to draw the masked bitmap but cannot figure out the appropriate matrix calculations to do so. My code works correctly to reflect position, scale, offset for centering without rotation. When rotated, the angle is cor...

How do I create a "closed" Flex Accordian control?

I'm trying to create a navigation panel based on the Flex Accordion control. The 2 things I'm trying to figure out are how to: modify the Accordion so that all of the of "panels" are closed by default. (normally one of the panels is open by default) treat some of the Accordian headers as just simple buttons (ie you click and an event ...