actionscript-3

Flash Remoting with Array of Objects and 2D Arrays

Hi again, I'd like to use AMFPHP and Flash Remoting to set up a system in which an array of objects on the Flash client gets checked against a mirrored array on the server. I've never used Remoting or AMF before, but I have worked on some projects that involved serialization, and I remember serializing an array of objects and arrays of...

Disabling/re-enabling interactivity

Hello, As an AS3 beginner, I'm trying to translate an old AS2 trick into AS3. I want to disable then re-enable any kind of interactivity with all the display objects on the stage, at once. For example while waiting for external assets to load or after a user clicks on a menu item. This what I used to do with AS2 : protect_mc.onRelease...

Video loaded using NetStream hangs in 10.0.2.54, but plays in 10.1.x.x Flash Player

Good day! I'm loading flv file using Video and Netstream (trivial example from docs). On Flash player 10.1 everything works fine. On 10.0.2.54 everything stops on NetStream.Play.Start. May be this is some well known bug? Thanks in advance! ...

external swf shows up as 5 flashing dots

I'm trying to load a swf file into my main swf. Everything looks fine when I test it with ctrl-enter, but when I open my main swf in a browser it just shows 5 flashing dots where the loaded swf should be. Any ideas whats going on here? ...

Limit angle to segment

I need to limit an angle so it fits into a segment. I have drawn and links to a diagram below to better describe what I am after. I am trying to calculate this for a computer program, where I have an angle (slope), and a point (the mouse pointer). The distance does not matter to me, just the angles. If the point is within b1 (green area...

AS3: Extending default ScrollBar component

I'd like to adjust the width of the default ScrollBar that appears inside of a Flash ComboBox. From my research on various forums, it seems like the best approach would be to subclass fl.controls.ScrollBar, which I've tried doing here: package helpers { import fl.controls.ScrollBar; public class CustomScroller extends fl.controls...

programmatically optimizing expressions (by removing redundant computations)

I had a pretty big equation that I needed to use to solve for a given variable. So I used an online tool that was capable of rewriting an equation in terms of a given variable. It gave me some huge 700 character equation. I tested it, and it does work. I can see some pretty obvious redundancies in the equation where it's recomputing a v...

Center aligning SWF in Flash breaks video prompt request

Hello, I'm using swfobject to inject my swf. My SWF basically initiates a webcam and prompts the user for access to the cam. Problem is whenever I center align the div that contains the swf object the Allow/Deny button seems to be unresponsive/not clickable. It's the oddest thing. Here is the site for you to view the coding: http://tin...

Can't pass data from child to child

I have a parent and 2 children. I am trying to pass data from child1 to child2 but keep getting an error message: 1061: Call to a possibly undefined method through a reference with a static type. In child1 I have the following code: [Bindable] public var TestVar:String='sometext'; In child2 I am trying to get the value of TestVar an...

Why does my Actionscript 3 program randomly get stuck in an infinite loop?

mBlocks is a 2-dimensional array of Block objects. Every time my application runs, it runs the InitGridNumbers function. Sometimes, it will get stuck in an infinite loop. Other times, it builds and runs without issues. public function InitGridNumbers():void { var tempRow:Array; var tempColumn:Array; var tempNum:int; for ...

Convert Byte Array from Action Script to Image in Java and save it

Hi Guys, I am a .NET Developer, but the question I am having is not related to .NET Please keep this in mind even if my question sounds very trivial. This is my question: We have an swf in the browser, which communicates with a java extension Its done using Smartfox Server(Used for MMO apllications) From the swf we are grabbing a por...

Input TextField 'bug'

I try to get input from a textfield of type INPUT and save its numerical value on a couple of variables, but when i enter for example 1 or any digit i get Nan in the trace debug, after i put another digit i get the first after i put another one i get the first two and so on so forth. What i am doing wrong? Here some snippets from my code...

Flex:- draw a pie chart in a popup window

Hi friends, I have drawn a pie chart,I want that when I roll over my mouse on this pie chart, a popup window opens and the same pie chart is drawn in this popup window.(Only the pie chart in this popup window is magnified).Take any input directly. Thanks in advance. ...

Dispatching events between classes

I have a custom event class public class FFTDrawEvent extends Event { public static const DRAW_EVENT:String = "drawEvent"; private var _param:Array = new Array(); public function FFTDrawEvent(type:String, __param:Array, bubbles:Boolean=true, cancelable:Boolean=false) { _param = __param; super(type, bubbles...

1180 error:Call to a possibly undefined method addFrameScript in as3

package { import flash.display.Sprite; import flash.utils.*; public class SetTimeoutExample extends Sprite { private var delay:Number = 1000; // delay before calling myDelayedFunction public function SetTimeoutExample() { var intervalId:uint = setTimeout(myDelayedFunction, delay,stopTime); } public function myD...

How to Convert ActionScriptObject to ByteArray?

Hi Guys, The coding language is Java. I have a ByteArray embedded in ActionScriptObject.(Smartfox Server) I want to convert it into ByteArray. The idea is to save it as an image. This a sequel to the post --> Convert Byte Array from Action Script to Image in Java and save it Have tried this method It failed with the java.io.NotSeri...

create an array of words (Strings) from String

How do I create an array of strings from a string, eg. "hello world" would return ["hello", "world"]. This would need to take into account punctuation marks, etc. There's probably a great RegEx solution for this, I'm just not capable of finding it. ...

how to do this in action script

Number type variable for eg xxxx=0.200000585858; how do i convert xxxx value as 0.200.......thnaks ...

Video is corrupting when compiled with mxmlc but not Flash IDE

Hi, I have movieclips containing FLV video sequences. When this FLV plays in a SWF compiled from mxmlc, the video is completely corrupted - all different coloured blocks. If I compile from the IDE the video plays fine. It's a bit more involved than this: if I play multiple copies of the same FLV at the same time, they're fine, wher...

Ease rotation and position of MovieClip to mouse, math help

Essentially what I'm trying to do is nearly the same as this: http://www.senocular.com/flash/source/?id=0.16 However I'd like to ease/tween the movieclip position and rotation to the mouse position. The main issue I see is trying to get the current movieclip rotation and the target rotation, then tween it cockwise or counterclockwise f...