actionscript-3

Best way to dynamically load an xml configuration file into a Flex4/Flash movie at runtime?

家住魔仙堡 提交于 2019-12-13 17:07:21
问题 I've got a rather simple question about loading in an xml file at runtime in a SWF. I've found a couple different methods to load in the xml. myXml.load("file.xml"); HTTPService object URLStream object What is better way to load an xml file that always has the same name and is located in the same folder as the SWF on the web server? 回答1: I would use URLLoader - I think that's the most lightweight one. The complexity of URLStream is unnecessary as far as a configuration file is concerned.

Fastest way to get an Objects values in as3

一笑奈何 提交于 2019-12-13 16:46:08
问题 Ok, so I swear this question should be all over the place, but its not. I have a value object, inside are lots of getters/setters. It is not a dynamic class. And I desperately need to search an ArrayCollection filled with them. The search spans all fields, so and there are about 13 different types of VOs I'll be doing this with. I've tried ObjectUtil.toString() and that works fine and all but it's slow as hell. There are 20 properties to return and ObjectUtil.toString() adds a bunch of junk

Flash AS3 - How do I access display object in other frames (aka a frame other than one)

一世执手 提交于 2019-12-13 16:42:27
问题 getChildByName('name') will work as long as that child is in the first frame. 回答1: Display objects in other frames haven't been instantiated yet, so it's not so much that you can't access them; they aren't there to be accessed. When the playhead passes into a keyframe with a certain object, that object is created and added to the stage, and when the playhead passes into a new keyframe that doesn't have that object, the object is destroyed. So the only way to access the object is to

How to force the NetStream to create a keyframe?

本小妞迷上赌 提交于 2019-12-13 16:32:58
问题 I created a video stream recording application that works fine except the recorded FLVs are corrupt a little bit. :) If I open an FLV in VLC player everything is green but getting "clean" when changes occur. And especially at the beginning of the video is breaking up. (I use Red5 1.0) 回答1: For pre-recorded streams, the keyframes are already encoded into the file and they cannot be changed. If you're serving a live stream, the keyframes need to be set in the application that is encoding the

How to remove row from datagrid?

泪湿孤枕 提交于 2019-12-13 16:23:30
问题 I have a datagrid from which I'd like be able to remove rows at will. Below is the component item renderer I'm putting together in order to achieve desired result, but there has to be a better way to access the data provider of the "parent" data grid. Anyone have any ideas/suggestions? <?xml version="1.0" encoding="utf-8"?> <s:MXDataGridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" focusEnabled="true

AS3 Flash/AIR recording video with webcam and save it

浪子不回头ぞ 提交于 2019-12-13 16:14:38
问题 Is it possible for AS3 to record a video with a webcam and save it to a local disk/to a network server? 回答1: You can use an Air app called AirCam to achieve this. It uses the BitmapData class to generate a FLV file. If you want to build it yourself they also include the the source code on the site. There class does not support sound though. The purpose of this revolutionary new class is to record a stream of BitmapData to a FLV-file, because writing directly, and especially the converting

Actionscript 3 setting multiple variables of an object in an array possible?

人走茶凉 提交于 2019-12-13 16:12:25
问题 Right now, I have many MovieClips 's in my array. I want to update all the alpha values of the MovieClips in my array. Right now, I am using a for loop but this is not the fastest way to do it. Is there a way to set values for all the items in my array? Thanks! 回答1: No. ActionScript doesn't have any constructs that allow you to change properties of all elements of the array with a single line of code. There is an Array.forEach() method, but I think that would be slower than a simple for(i = 0

Loading an embedded image in AS3

强颜欢笑 提交于 2019-12-13 16:05:19
问题 OK, I feel dumb asking this, but I've spent the whole afternoon trying to figure it out, without success. In AS3, I want to add an image to the Library (let's call it image.png) and instantiate it using just code. I succeeded in instantiating an external image this way var pLoad:Loader = new Loader(); pLoad.load(new URLRequest("image.png")); addChild(pLoad); But no matter what I tried, I can't do the same loading the image from the library. How is that done? Aside : I've seen the [embed]

Flex vs ActionScript

大城市里の小女人 提交于 2019-12-13 16:02:03
问题 I'm trying to build/implement a Flash video player to play videos. I have looked at Flex and built a basic application with just a VideoElement. It gets compiled to 41k without statically linking the libs and 300k with linking the libs. I generated the report but am still not sure why I would need all those components just to build a VideoPlayer. On the other hand, I have had a look at some implementations in ActionScript and it's compiled to 10K. Why is the file size so different in Flex

AS2 .swf loadmovie() and unloadmovie() fail when nested inside an AS3 .swf container

▼魔方 西西 提交于 2019-12-13 15:26:45
问题 I have an AS2 .swf being loaded as a child of a parent AS3 .swf. The AS2.swf calls loadmovie() and unloadmovie() to display 3 jpeg files. The images load the first time, but after that, a call to loadmovie() to replace the image, or a call to unloadmovie() fail. I found the following Adobe Bug report (https://bugs.adobe.com/jira/browse/ASC-3338?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel) that has said this has been resolved, and also said that child movieclips could be