actionscript

Is there a way to call a Javascript class method from ExternalInterface?

点点圈 提交于 2019-12-06 07:35:40
I can call JS functions with ExternalInterface.call('func_name',.args) . OK But what if I would like to call a js class instance method instead? ExternalInterface.call('obj.method_name',.args) //this seems not to work Is there any way of doing it? Luca It was only a matter of scope. You must instantiated the swf object outside the js class. Then I can reference it in ExternalInterface.call() . window.addEvent('domready',function(){ swf = new Swiff('../files/swf/italy.swf',{ id:'italy', container:'italy-flash', width:280, height:323, params:{ bgcolor:'#ffffff', wmode:'opaque', allowScriptAccess

Removing all event listeners in Flex

最后都变了- 提交于 2019-12-06 07:32:44
问题 How can I remove all event listeners on all components at once, especially when it is not known what listeners are attached to each component? 回答1: You can override mx.core.FlexSprite, which UIComponent inherets from, and generate an array of listeners created. Doug Mc Cune put up source code here. His blog says: removeAllEventListeners() – removes all event listeners of all types. This completely wipes out all event listeners for the component all at once. Let us know if this does the job!

Matching web service results to requests in Flex

耗尽温柔 提交于 2019-12-06 07:30:22
问题 A little (!) bit of background before I can get to the question : I have an accordion control loaded with an array of grids, each of which is lazy loaded with arrays of things. I'm using an auto-generated web service proxy to retrieve these lists. I'd like for the user to be able to change the selected child in the accordion without having to wait for the web service to respond. I was originally using the same proxy instance for all requests and keeping track of the requests in the order they

How to get a bytearray from file stream in Adobe AIR?

对着背影说爱祢 提交于 2019-12-06 07:15:26
I read limited (small - 15 - 500 mb files). I need to be able to put all file bytes into one single bytearray. So I have a function: [Bindable] public var ba:ByteArray = new ByteArray; //.... code ....// protected function fileOpenSelected(event:Event):void { currentFile = event.target as File; stream = new FileStream(); stream.openAsync(currentFile, FileMode.READ); stream.readBytes(ba); stream.close(); MyFunction(ba); } But it does not work=( - gives me Error: Error #2030: End of file was encountered. How to get a full bytearray from stream to use it as normal bytearray? isn't the point of a

Getting Computer information using Flash

让人想犯罪 __ 提交于 2019-12-06 06:55:42
问题 Is it possible to retrieve computer information (RAM, hard drive size, cpu speed, etc.) using Adobe Flash? If so, can someone point me to a web site showing me how? 回答1: I don't think you can get RAM, hard disk size, or clock speed — Flash runs in a virtual machine, and it's probably set up to only give you information that pertains to its little world. You can get a lot of other client information, such as how much RAM Flash is using, screen resolution, and whether the client has audio

Synchronous calls using RemoteObject

穿精又带淫゛_ 提交于 2019-12-06 06:10:57
Is there a way to make synchronous calls using RemoteObject in Flex? James Ward All IO in Flex is asynchronous. The typical pattern to deal with this is to use an AsyncResponder . For instance: var t:AsyncToken = remoteObject.methodCall(); t.addResponder(new AsyncResponder(resultEvent, faultEvent)); think twice when u want it to be synchronous. Do u know what synchronous mean? it will FREEZE your application until it receive data. Unless u are pretty sure that your remote calling can receive return value immediately (super fast network connection). if your function call depends on each other,

How to get the visible items on a Spark List with virtual layout

╄→尐↘猪︶ㄣ 提交于 2019-12-06 05:49:16
I have: an ArrayCollection of Numbers; a List using the above ArrayCollection as it's dataprovider, and virtualLayout=true; a custom ItemRenderer that shows a label with: a) the number b) an y position depending on the number AND the highest number visible In another words, if I have 10 numbers in the AC, and only 5 appear on the screen, the y position of those 5 will depend on the value of the maximum number for those 5. When the user scrolls, of course those 5 elements change so the position of the label in item renderers will change. My questions: 1) How can I get the list of items that are

Using Actionscript 3 to connect to a database

落花浮王杯 提交于 2019-12-06 05:38:20
I'm looking for advice on how to dynamically create content in flash based on a database. Initially I was thinking that we would export the database to an XML file and use the built in Actionscript XML parser to take care of that, however the size of the XML file may prove prohibitive. I have read about using an intermediary step (PHP, ASP) to retrieve information and pass it back as something that Actionscript can read, but I would prefer not to do that if possible. Has anyone worked with the asSQL libraries before? Or is there something else that I am missing? Unless you're running your

Zipping and Unzipping tool for Flash ActionScript 2

怎甘沉沦 提交于 2019-12-06 05:33:03
问题 Are you aware of any zip/unzip component or script for flash / actionscript 2 ? I'm aware of this library for flex / AS3, but is there one for AS2 that will save me a long conversion attempt? Is there such a library that supports creating/parsing password protected zip files? 回答1: basically it can be done ... but will be slow ... http://code.google.com/p/hxformat/ actually you would load the string and then it'll be decoded into an Array of bytes (using Bytes.ofString) ... this will take a

Is there a way to read local files in ActionScript 3 “silently”'?

痴心易碎 提交于 2019-12-06 05:20:29
I'm developing an application and because of certain design restrictions I have to do it in Flash. This application communicates with another one done in c++, but just because I need a couple strings, so I thought it would be easy to write them to a .txt file and parse it. But the only way I've found so far is adding a browse event handler and select the file manually. That's no good for me, I need the file to be read automatically given a path, something like: var data:ByteArray = fileRef['C:\whateverPath']; var loader:Loader = new Loader(); loader.loadBytes(data); Can this even be done?