actionscript-3

Detect if camera is capturing in Flash

I'm having trouble with Camera.getCamera() in Flash AS3. If there are multiple camera drivers, it does not necessarily pick the correct one. If the default is the correct, the program works fine; however, if another driver is selected as the default then LED on the webcam does not come on and no video is captured. I can cycle through th...

Flash CS5 and dynamic textfields

I have a "shell" that started life in Flash CS3 (Flash 9, AS3) that has been since used with CS4 and now CS5. It creates TextFields in ActionScript for display (reading the content of those fields from XML). The text fields are either Myriad Pro Regular or Myriad Pro Semibold, both are embedded in the SWF from the Library (any given text...

changing "enabled" value of a button during runtime in flex

i want to make a button disabled if a datagrid is empty and it should be enabled when there is atleast 1 entry.the entries in the grid are made at runtime.I tried this this is the button: <mx:Button id="update" label="Update Contact" enabled="{isButtonEnabled()}"/> and the function is defined as where dg_contact is the datagrid: publ...

Flex Chart duration x days

I was given the task of building a flex 3 chart that relates each day(ex: 15/06/2010) of a pre-determined period with a time in hours (ex: 03:34:45 -> that would be 3 hours, 34 minutes, 45 seconds). In other words, a certain amount of time in hours for each day. I've managed to set the 'days axis' using DateTimeAxis. But I'm clueless ab...

How to count retweets

Hi, I am trying to create a flash retweet button, and i want to know how to count the retweets for a specific status. Can anybody help me? Thanks in advance, Alex ...

Type 1046: Type was not found or was not a compile-time constant: NetworkInfo.

Hello, Just started playing with the new AIR functions NetworkInfo and NetworkInterface, but can't build ... This is the example I started from: tourdeflex But these lines cause errors: var networkInfo:NetworkInfo = NetworkInfo.networkInfo; var networkInterfaces:Vector.<NetworkInterface> = networkInfo.findInterfaces(); Any ideas on...

Communication between Flash and C# Using ExternalInterface without TLF text

I'm communicating from a flash application using a command like the following: ExternalInterface.call("hello", "world") This is handled on the C# end by something like: string swfPath = Directory.GetCurrentDirectory() + Path.DirectorySeparatorChar + "test.swf"; this.axFlash.LoadMovie(1, swfPath); this.axFlash.FlashCall += new AxShockwa...

Adding a MovieClip from inside a class method

Hi to everyone, I have been trying to add a movieclip to my .fla file from a class. my main fla file: main.fla actionscript file: script.as they stay in the same directory. script.as file as follows: package { import flash.display.* public class MyClass extends MovieClip { public var target:MovieClip; public function MyCl...

Hide Flex Component From SWFLoader

How can I hide a component and what AS3 code to use to hide a Flex Component from an external swf file? ...

I can't get ExternalInterface.addCallback to work - trying to call an AS3 function from a js button click.

I'm trying to use ExternalInterface.addCallback to allow js to call an as3 method. My code is as follows: AS: ExternalInterface.addCallback("sendToActionscript", callFromJavaScript); function callFromJavaScript():void{ circle_mc.gotoAndStop("finish"); } JS: <button type="button" onclick="callToActionscript()">Switch to square</...

How do I set the width and height of my swf in AS3?

How do I set the width and height of my swf in AS3? This is my code so far: package { import flash.display.Sprite; public class Game extends Sprite { } } Right now, when loaded it is at some arbitrary default size. If I can't change the size this way, is there any easy work around that will be consistent? ...

Flash: How to dispatch a click event at the top of a loaded .swf?

So I'm trying to build a tool that will allow me and other users to all open the same .swf, and then I as the Admin user am able to interact with mine while they all see my mouse movements and button clicks etc on theirs. I'm using BlazeDS to manage this and I'm getting data sent back and forth etc - no difficulties there. The issue I'm...

Flash/ActionScript - Making Sprites With the IDE

i've been studying and using actionscript exclusively for too long, that i don't even know how to import a regular image into Flash and create a ready-made sprite that i can use in my APIs. what are the steps to create a sprite from an image asset in the library? ...

Acess itemRenderer in List

How to access List itemRenderer and its properties (Spark - Flex 4)? I want to iterate through list and do something like (note it's pseudo code): for (var i=0;i<NUMBER_OF_ITEMS_IN_LIST; i++){ myList.getItemRenderer[i].property } ...

Dynamic Google Maps API InfoWindow HTML Content

I am working in Flash Builder 4 with Google Map's ActionScript API. I have created a map, loaded some custom markers onto it and added some MouseEvent listeners to each marker. The trouble comes when I load an InfoWindow panel. I want to dynamically set the htmlContent based off of information stored in a database. The trouble is tha...

AS3 function running before variables are defined!

I am trying to add an init() function to a MovieClip, but when I run the function from scene1 the variables that were set in the MovieClip are not defined yet... The MovieClip was dragged to the stage from the library. scene1: mc.init(null); MovieClip: var _default = 5; function init(num) { if(num == null) { trace(_d...

Mouse move panning

Hi all, I'm trying to scroll a series of thumbnails horizontally based on the mouseX position. I can get it to scroll but it's very choppy and for some reason it's not reading my start and end numbers so it will stop scrolling. Can anyone point me in the right direction? Thanks. var thumbBounds:Object = new Object(); thumbBounds = thu...

Determining linkage dependencies in Flex applications

I have a large Flex project with two Applications in it. A lot of code is shared between these Applications. However, the smaller of the Applications does not require much of the code that the larger one does. I'm trying to ensure that code that isn't required by the smaller application isn't getting compiled into it. Is there an easy w...

Reading xml within xml as String in flex/AS3

I'm getting XML input that looks like this <?xml version="1.0" encoding="utf-8"?> <data1>this is data 1</data1> <data2>this is data 2</data2> <data3> <3a>this is data 3a</3a> <3b>this is data 3b</3b> <3c> <TextFlow xmlns="http://ns.adobe.com/textLayout/2008"&gt; <p direction="ltr" > ...

Flex HTMLLoader component not raising mouseDown events for all mouse clicks

I have built a Air 2/Flex 4 kiosk application with Flash Builder 4. Currently I am implementing a touch screen browser to enable users to navigate company training videos. In an attempt to improve the usability of the website on the touchscreen I have placed the HTML component in an adaption of Doug McCune's DragScrollingCanvas (updated ...