actionscript-3

AS3 Touch Class Examples?

Anybody know any good resources for touch interface in AS3? Maybe with example downloads of simple user interface examples such as swiping lists etc. I could write code that reacts to the mouse events but I was wondering if their is a more a intuitive way of doing it using the native touch events class? Thanks. I also believe better 3rd...

Is there a way to check if DisplayObject A is a descendant of DisplayObject B?

I would like to be able to quickly check if a given DisplayObject is a descendant (not in the inheritance sense - ie. child, grandchild, great-grandchild, great-great-grandchild, etc.) of another DisplayObject. There doesn't seem to be a native way to do this and I can only think of two ways to achieve it: Create the mother of all nes...

ItemRollOver with a custom ToolTip

I have this custom toolTip: <?xml version="1.0" encoding="utf-8"?> <mx:VBox xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" implements="mx.core.IToolTip" creationPolicy="all" cornerRadius="4" borderStyle="soli...

Sending image data from Flash to PHP GD, Will it take too much resources?

If i send bitmap data from Flash AS3, to PHP and then PHP turns the bitmap data into a image file and saves on server... Would it take too much resources? I mean, The Bitmap Data could contain too much pixels etc does that affect the resources? If 10-100 people send data simultaneously is it going to cause problems... What kind of spec...

How to use navigateToUrl to access html files relative to the site root?

Hi! I try to make an intro animation inside a website, and when the animation is done or when you push the Skip button, it navigates to the index.html file from the site root. So I have in my site root the folder Flash, where the intro.swf is, and within the intro.swf I called the navigateToURL(new URLRequest("..\index.html"), "_self")...

Copy file to application directory

I have trouble getting it to copy file from src to destination. var asMsg_path:String = fileRef.nativePath; var origFileLoc:File = File.applicationDirectory.resolvePath(asMsg_path); var newFileLoc:File = File.applicationDirectory.resolvePath("/java/"+asMsg); launch an AIR app in debug mode. I need to copy a file from asMsg to the Java...

AS3 Date problem

Any idea why the day is coming out wrong when the date is accurate? I'm debugging and I can see the date variables which are correct but the day is wrong. date Date (@9f14161) date 26 [0x1a] dateUTC 26 [0x1a] day 5 dayUTC 5 fullYear 2010 [0x7da] fullYearUTC 2010 [0x7da] hours 17 [0x11] hou...

What is loaded in first frame?

Hi! I'm building a flash game wish contains sounds/images/videos and such. Now I want to build a preloader for this game. The problem is that currently it is around 2 mb of data in the first frame. How can I see wish objects that are being loaded in the first frame? Thanks, ...

How to achieve this effect with AS3

Hi Guys, A client has asked for a spinning wheel as part of their navigation. The user is faced with the edge of the wheel with the various navigation items on there, and they spin it with a click/drag of their mouse. Whatever it stops on is what page they are presented with. The only example of this I could find to help illustrate what...

POSTing ByteArray Data from AS3 to PHP

I have this: import JPGEncoder; var bmd:BitmapData = new BitmapData(stage.stageWidth, stage.stageHeight, true, 0); var bm:Bitmap = new Bitmap(bmd); bm.alpha = .5; stage.addEventListener(MouseEvent.MOUSE_DOWN, screenCap); function screenCap(e:Event):void { bmd.draw(this); var jpgVersion:JPGEncoder = new JPGEncoder( 80 ); var jpgStream:...

Event registrer on children rather than parent

Hi all, Hopefully a quick question here. I have setup a "LayoutPage" custom class (based on MovieClip) and I am attemptimg to create a "selected" behaviour. When I assign my "addEventListener(MouseEvent.CLICK,toggleSelection)" from within my custom class, everything works as expected, clicking any object of that class does display the ...

Influencing state of an itemrenderer

Hello, I'm new here and to Flex. Hope someone can help me out. I've searched around this site and google in general for a solution to my problem but no joy so far. I have a custom version of a combobox (named MultiplePriority) which extends ComboBox. It's basically a combo box but with checkboxes for its elements as opposed to just ...

Flex 4 UI Mis-Behavior

Hello, So here is the problem, below is basically my application wireframe in mxml. The problem comes in when I'm looking at a report component, so the reportComponents is visible, not the filterComponents. What is happening is the UI element is sliding outside the container to the left when the browser resizes, it literally slides rig...

AS3 ENTER_FRAME event still firing when frame changed

Why won't this ENTER_FRAME event stop firing when I call view_stats_exit before going to view_start? public function view_start (e:MouseEvent):void { gotoAndStop("start"); } public function view_stats(e:MouseEvent):void { // Event StatsUI.addEventListener(Event.ENTER_FRAME,stats_scroll); } public function view_stats_exit (e:...

OSMF/ActionScript 3 - detecting the end of a live RTMP stream, etc.

What's the best way to check whether there is video data (or not) in a live RTMP stream? For example, if a broadcast terminates, can I auto-detect that condition, to perform some sort of "thank you for watching" behavior? Also, how can I know if a visitor somehow gets disconnected from the Internet during the broadcast? (So I can notify...

actionscripts Clone the instances

Have anyone found any solution for cloning the "Instance name"? Here is what i mean. Draw a random shape using flash not the actionscript Convert it to "Symbol" Assign the instance name to "cloneMe" now try to clone it The code should be something like this. var newClone:MovieClip = cloneMe.copy() newClone.x=100 newClone.y=50 add...

Problem in Flash TextField

Hi Guys, I want to design a calculator by Flash cs5 , I use appendText Method to write the data in the textfield by the Keyboard . My problem is when I start the application I have to Click on the TextField first then type the numbers . How i can solve it . Cheers, Maged ...

Using flex combobox to select a tree node

I'm using a flex combobox component in Flex builder 3 with sdk 3.4 and I'm trying to use it to expand and select the tree node that the user selected in the combobox component on the change event. However, I'm getting an error when I go to assign the combobox seletedItem to the tree selectedItem. Can you please help? What am I doing wr...

Knowing which instance of a symbol the event listener came from?

I need some help! I have no doubt this is a dumb problem that I've just over-thought to the point I got dumb about it. I've got one "main" instance of a MovieClip symbol (let's call it Mountain) with an accompanying class. In the flow of the program, I automatically generate 8 other instances of the same symbol, let's say, each has a di...

DataGroup TileLayout autoheight

I have DataGroup with TileLayout. How to make datagroup resize accordingly to number of elements in datagroup? For example 1 have 1 row with 4 elements. Each element is 20 pixels tall. So I want my datagroup to be 20 pixels tall as well. If I have 7 elements which will be 2 rows I want my datagroup to be 40 pixels tall and so on. Right...