actionscript

Flex: DeepCopy of FileReference

Hi, in my project, I let users pick pictures using the FileReference class. I then load these pictures into their .data properties, using the load() function. After this I perform some local manipulation and send them to the server. What I would like to do, is to be able to iterate over the picked FileReferences again, load them into ....

Spherical Coordinates within a range / restriction

The function below returns points on a sphere with a given radius. I want to add restriction such that points cannot be plotted within 30 degrees of the poles of the sphere. public static function randomPoint(radius:Number):Number3D { var inclination:Number = Math.random() * Math.PI*2; var azimuth:Number = Math.random() * Math.PI*...

Share cookie/data between multiple domains and swf's

Hi, I am trying to create a login system where a user would be able to login inside of one flash game on say, example.com, and then that same login data would be preserved for all the games on example.com and also the games on foo.com and bar.world.com I am new to shared objects in flash so if anybody knows of a way to do this in either...

Itemrendrer : Adjusting container height to Text height to avoid text truncation

hi, I have a datagrid with variable height. I have written a Itemrendrer for rendrering data. now there is one more part that is the text field. i would like to resize the comtainer height to that of the text field so that the text doesn't get truncated. Thanks sohil Following are my classes Auto Resize Text Area package { import ...

Cancel a net stream to fms server from flex

Hello, Is there a way to cancel a netstream publish from flex to a flash media server? The issue is I have code where I can Start/Stop a recording to my Flash media server. However in my front end I have a cancel button which allows the user to cancel the current recording and all this code essentially does it close the netstream. ...

Flash CS3: Textfields distort/disappear in fullscreen mode

I am using Flash CS3 to build a website that uses Flash video. When I have Textfields over the video, they display fine when played "normally" in the browser window. However, when I put the video in fullscreen play, the Textfields either vanish completely or get highly distorted (they get very skinny and tall). Worse, when I hit escape...

Convert a Relative URL to an Absolute URL in Actionscript / Flex

I am working with Flex, and I need to take a relative URL source property and convert it to an absolute URL before loading it. The specific case I am working with involves tweaking SoundEffect's load method. I need to determine if a file will be loaded from the local file system or over the network from looking at the source property, a...

Flash Lite 3.1 + javascript

I know almost nothing about actionscript. Is it possible for Flash Lite 3.1 to use the flash.external.ExternalInterface to allow javascript interaction? If it is possible, can someone explain why jPlayer (open source) doesn't work on the Wii? I have been looking for a flash mp3 player that will work on the Nintendo Wii and which suppo...

Flash Dynamic TextFiled Font Issue on BOLD

Hi, am using AS3 and i have one dynamic text filed. The properties Fontname "verdana" size "14" style "Bold" it is shown the correct font in BOLD if there is no value if i assign values like priceText.text=" Hello Wold" It will not show the correct font properties am not getting the bold style :( What need to change? ...

Turn off anti-aliasing for fonts in Flash?

Flash can use 2 types of fonts such that they can be changed at runtime by actionscript. system fonts - NOT anti-aliased so renders fast embedded fonts - anti-aliased so renders slow The problem with "system fonts" is that you can't rotate the text. Can I use embedded fonts AND turn off the anti-aliasing so it renders fast? ...

Flex: How to call function of embedded swf?

I have a Flex 3.4 app that embeds a swf with mx:SwfLoader... That swf has a public function named "playIt". I've tried dispatching events to gettingHere.content, casting gettingHere.content as a MovieClip and other stuff... var swfApp:MovieClip = MovieClip(gettingHere.content); if (swfApp.hasOwnProperty("playIt")) { var helloWorl...

comparing date objects in as2

I must be missing something. date1 = new Date(2010, 01, 10, 12, 10, 30, 000); date2 = new Date(2010, 01, 10, 12, 10, 30, 000); trace(date1 == date2); // returns false However, date1 = new Date(2010, 01, 10, 12, 10, 30, 000); date2 = new Date(2010, 01, 10, 12, 10, 30, 000); trace(date1.toString() == date2.toString()); // returns tru...

Which is faster? An empty statement or a return

I've always been curious about this. Between the two code example which is more processor efficient? I understand that various languages may be different and I need to know what the answer is in PHP, but I am also curious about javaScript, CFScript, and ActionScript if the answer would be different. Thanks ps:The example may not be exa...

Why are animations sometimes done using steps based on the amount of time that's passed?

I've noticed that some programmers animate objects based on the difference in time. I am not sure why or even if this is logical. Does anyone know the significance? Below is a snippet of code that explains what I mean: var timePassed:int = getTimer()-lastTime; lastTime += timePassed; var newBallX = ball.x + ballDX*timePassed; var newB...

getting an area of a object

I am trying to get the four corners of my object. To test out whether its accurate enough. use a method to trace a message when my mouse passes the objects bottom, left, right, or top. when the object is positioned at coord 0,0. it works perfect. but when I reposition it. It becomes off and I have no idea why. here is my code. in my cla...

Flex: change the application windows size

I am embedding the swf into a c# winform, now what I want to do is when I click a button inside the swf, the swf's size is changed. I have tried to use the stage class but failed, the system said the width/height property is not implemented: protected function button1_clickHandler(event:MouseEvent):void { sta...

flex: the size of the VideoPlayer can't be changed to be smaller.

I am using below code to change the size of the VideoPlayer, but in my result the control didn't change, just the video inside the control is changed. And it's weird that the video can be changed to be larger but can't be smaller. My aim is to change the size of the control, and the video will also be sized according to the size of the c...

Display objects not aligning correctly

I am aligning my display objects in the middle. stage.stageWidth/2. for some reason, they are aligning further off to the right of the screen. I haven't altered anything but the stage width in flash. Has anyone heard of this problem? Again, I haven't done anything except widen the screen and adjust the height. Here is the code I trie...

overriding subclasses in actionscript

Trying to find a straight answer for this. I am going to be creating some sub classes in actionscript 3. I was wanting to know if it is possible to override the parent class. If so, do I need to put a override assigner on the parent class method or what. Thanks guys ...

use flash action script to develop online games

For short: can you tell me some great resource to study if I want to develop online games using flash technology? Including 3D games. ...