apache-flex

Flex: How to create an entirely new component?

狂风中的少年 提交于 2020-01-03 13:30:44
问题 I'd like to develop a network graph application for Flex - imagine placing nodes on a Canvas and connecting them with links. The nodes should have editable text and other UI components. I'm trying to find examples of creating an entirely new UI component from scratch, but all I've been able to find are trivial examples that extend existing components: a RedButton that extends Button, for example, or a ComboBox that has states to choose from. My main question is, what ActionScript method

How to determine if a string contains a specific substring

╄→гoц情女王★ 提交于 2020-01-03 07:21:08
问题 Given a string A , how can I determine if that string contains the substring "video/x-flv" ? 回答1: A.indexOf("video/x-flv") >= 0 回答2: This is a little old now, but try if(A.indexOf(video/x-flv) != -1){ //Found it } indexOf will return -1 if the substring doesn't appear in it. So if it's anything but -1 it means it does exist, Hope this helps although I'm probably a bit late! 回答3: http://www.gskinner.com/blog/archives/2007/04/free_extension.html gSkinner hasText() function EDIT: NO Sorry -

format of ByteArray returned from C is invalid

此生再无相见时 提交于 2020-01-03 06:36:14
问题 following is code snippet: AS side:(img is reference to an <Image> instance) bitmapData = Bitmap(img.content).bitmapData; var pixels:ByteArray = bitmapData.getPixels(bitmapData.rect); pixels.position = 0; var output:ByteArray = new ByteArray(); img_width = bitmapData.width; img_height = bitmapData.height; ////invoke C code by alchemy lomoEncoder.encode(pixels, output, img_width, img_height); var newImage:Image = new Image(); //can't show the image newImage.source = output; C code: AS3_Val

Upload file to server in as3

情到浓时终转凉″ 提交于 2020-01-03 06:03:07
问题 How to upload a File to server in as3? I don't want to browse file by using FileReference.browse(). I tried using URLLoader to get the file and convert to byteArray but as I send it to server using URLVariables it gives IOError=2032. I want update database on the server. The structure would be like email (string) sqlite_db (Blob) I have to send both of these variables inside one request. Any idea! 回答1: The upload process is made much easier by using the UploadPostHelper which is a great class

how to stop FLEX from caching?

不打扰是莪最后的温柔 提交于 2020-01-03 05:52:27
问题 i'm working with a flex app I didnt design myself, in fact i really don't know much about the workings of flex. I want to disable all caching since its causing a lot of problems since we changed to a new payment method. I know the disabling cache isnt ideal, but it just needs to be done for the moment. I found a server side solution for this, but my implementation of it doesn't seem to work. i tried setting it in the header, here's the piece of code for my index.html <head> <meta http-equiv=

FileReference.save() duplicates ByteArray

依然范特西╮ 提交于 2020-01-03 05:51:24
问题 I've encountered a memory problem using FileReference.save(). My Flash application generates of a lot of data in real-time and needs to save this data to a local file. As I understand, Flash 10 (as opposed to AIR) does not support streaming to a file. But, what's even worse is that FileReference.save() duplicates all the data before saving it. I was looking for a workaround to this doubled memory usage and thought about the following approach: What if I pass a custom subclass of ByteArray as

AIR: securityError on OSX (but not on Windows) with URLStream()

社会主义新天地 提交于 2020-01-03 05:22:09
问题 I'm using URLStream to load a file from the harddisk (and I'd like to continue to use URLStream to do so). The file is located in "app-storage:/myfolder/myFile.zip" so I use var f:File = new File("app-storage:/myfolder/myFile.zip"); myStream.load(new URLRequest(f.nativePath)); on Windows this seems to work without problems - but on OS X the URLStream dispatches a SecurityErrorEvent.SECURITY_ERROR with the message: Error #2032: Stream Error. URL: app:/Users/myUserName/Library/Preferences

Best way to show image sequence as a movie in Adobe AIR

冷暖自知 提交于 2020-01-03 05:11:07
问题 I need to show an image sequence as a movie in an Adobe AIR application - i.e. treat lots of images as video frames and show the result. For now I am going to try simply loading them and displaying in a movie clip but this might be too slow. Any advanced ideas how to make it work? Images are located on a hard drive or very fast network share, so the bandwidth should be enough. There can be thousands of them, so preloading everything to memory doesn't seem feasible. Adobe AIR is not 100%

Log out from facebook

我只是一个虾纸丫 提交于 2020-01-03 04:30:06
问题 Well i developing a Flex desktop app and i cant logout form facebook. I mean after loggin in and updating the photo i want to update, i run the method to log out, which looks like this FacebookDesktop.logout(handleLogout); Where handleLogout is a function where i can do other things. The method runs but never log out. I think that maybe loading an other request i could log out, and i find that using: "https://www.facebook.com/logout.php?" + info.get_accessToken() + "&next=http://www.Google

Adobe AIR: Controls flipped (mirrored) in certain build environments

◇◆丶佛笑我妖孽 提交于 2020-01-03 02:49:08
问题 I'm having an issue where certain controls are flipped, depending on the machine that I'm building my project on. On my development machine, when I build it, everything is okay. However, when I build it on our build server, some things are flipped. It seems to be things that are on a higher layer - for instance, options in the select control (see first image below), alerts/overlays (see second image below), etc. It's not just the text, either - the entire content is flipped, images and all. I