actionscript-3

Netstream bufferlength is zero when pausing. How to prevent that?

Hi, I am using Flex 3 and FMS3 from where I and sending a videostream. I want the user to be able to pause the stream, then resume it. For this I am using the methods pause() and resume(). The problem is, when I call pause() the bufferLength is released and equals zero. Accordingly when I resume, the NetStream needs to start buffering a...

What is different between below method on flex in action script3 ?

NativeApplication.nativeApplication.exit(); - this method is used for exit the application of flex/air . application.close(); - this method also used for exit the application of flex/air - So what is different? ...

Create Plugins in Flex - loading nested SWF files

I'm trying to implement a plugin system for our application, and having a devil of a time getting SWF file which was dynamically loaded itself, load additional SWF files. It goes something like this: Main Application Shell loads... ---------+ Application loads... -----------------+Plugin(s) I have no problem getting app #1 to load a...

extending a Singleton class?

Is there a way to make like a template singleton class so that when you extend it, the extended class is also a singleton class, so I can quickly make a new singleton class just my extending the template singleton class? I am using ActionScript 3.0 if it matters. Thanks. ...

How to pass custom variables to Flex applications

I'm trying to write an application where parameters have to be passed to the application. In Flex builder I modified the and tags in the index.template.html, but when debugging I still don't see the variables passed (using from as3 the Application.application.parameters object)... ...

In Flash: gotoAndStop and nested MovieClip issues

This is kind of an odd question, I hope this enough information to go on: In the flash IDE, I have a MovieClip that has 3 frames. In each frame, I have a series of TextFields. It's a poor mans viewstack basically - so here's the issue - in FP10 I can write the following code with no problem: public function showMenu():void{ got...

ActionScript 3 - Opening External files

Does anyone know of a way to open an external file from Flash in ActionScript 3 without the request first going through the browser. Specifically, I want to open a PowerPoint presentation directly with PowerPoint. I've tried: var url:String = "MyContent/My presentation.pptx"; var request:URLRequest = new URLRequest(url); navigateToURL...

Changing fill color of MovieClip Actionscript 3

Hi, i want to ask, how to change only fill color of an instance on the stage - i can do it by using ColorTransform object, but it changes color of the whole instance, not just the fill. I want to change only the fill color, not the stroke color. can anybody help me? this is my code: function paint(){ var myColorTransform:ColorTrans...

preload FLV in Actionscript 3?

Hi guys, I'm working on a flash site with lots of video-based section-to-section transitions. The transition videos themselves are only a few seconds long but are fairly weighty (~700kb) as they're very high-resolution; given the number of sections and section-to-section transition combinations (and therefore videos), preloading all of...

getting mx:CheckBox values from inside mx:Repeater

I have an an array of objects that I use as the datasource for my repeater. <mx:Repeater id="categoryRepeater" dataProvider="{this.allCategories}"> <mx:HBox> <mx:Spacer width="20"/> <mx:CheckBox id="categoryCheckBox" label="{categoryRepeater.currentItem.question}"/> </mx:HBox> </mx:Repeater> I would like to be able to tell which of th...

Why are .jpg's appearing yellow in my flash as3 application?

I retrieve .jpgs from my server and load them within my as3 app. I use Flash CS3, and am not using flex. Occasionally, some images will appear yellow and unreadable within the app. The actual original of the image is fine, and has no such yellowing, yet when I load the image in flash it appears yellow. This seems independent of size, cau...

how to get numbers to have precision of .05 ?

The following will ensure that any large numbers will only be precise to the hundredths place (related to this answer): public function round( sc:Number ):Number { sc = sc * 100; sc = Math.floor( sc ); sc = sc / 100; return sc; } What is the optimal way to round my numbers to the precision of .05? Is there something ...

How to add Stroke to Text in AS3?

I am coding in AS3 and want to add a stroke to text that I'm displaying to the screen. My current code is: format = new TextFormat("BN Elements", 14, 0xEEEEEE, false, false, false, null, null, "left"); format.font = "BN Elements" scoreText = initText(starsleftText, format, "", 160,5, 545, 61); scoreText = "Stroke This Text"; As the te...

How to export image from swf with ActionScript3/PHP?

Hi there, i have another piece for more advanced guys than me ;) I am developing a simple flash application to create your own coat of arms. When finished creating, it would be nice to save it as an image to a client's computer or to a database, i am not sure yet. The problem is making the image from swf content - i mean not the whole c...

Best way to skin flash player

Is there a good pattern to creating a flash player that is easily skinned, providing different dimensions, buttons, background color, etc? I've considered 2 approaches: 1 The player skin is flat. The logos and buttons are on one large background image. The actual trigger areas are transparent sprites, positions and dimensions defined by...

leading and trailing whitespace stripped from content of a text node when loading an XML file

In actionscript 3, when trying to load an XML file like <Element><Property> a </Property></Element> the value in the node "property" will be just "a", trailing and leading whitespaces are removed. I did what http://bugs.adobe.com/jira/browse/ASC-3125 recomends, with no success. Any ideas? ...

problem in itemClick

if (theData.hasOwnProperty("@id1")) { var myObj:Hello = new Hello(); textArea.visible = false; panel.addChild(myObj); } else if (theData.hasOwnProperty("@id2")) { textArea.visible = false; var vijay:MCQ = new MCQ(); panel.addChild(vijay); } When i click on the next item, the previous window is sti...

How to insert the image on right top corner of panel header using flex?

Anybody help me How to insert the image on right top corner of panel using flex or action script . i used -<mx:Panel x="38.5" y="28" titleIcon="@Embed('image/logo.png')" id="register" width="375" height="534" layout="absolute" title="Registration Form "> titleIcon attributs but not use . so how to insert ? ...

E4X: Expression not returning what I expected

I have an XMLList, I am trying to grab one from the list with a stone attribute == Opal but its not working, I don't understand why? Here is the code: var xml:XML = <bs><variation price="999999999.99" month="OCT" stone="Magic Pet Rock" image="https://www.sussexjewelers.com/birthstone_images/20_PE105-BT.png" style="PE105" gold_color="W...

E4X: Use string as attribute name in expression?

I have a function that has this line: var returnString:String = items[0].@month; @month is an attibute on an XML node like so: <xmlnode month="JAN"/> OK but I need to abstract the attribute name so I can pass a string to the function and get the contents of the attribute with the name matching the string I passed. So for example If...