flash

Are ints always faster than Numbers/Floats in AS3?

ぃ、小莉子 提交于 2019-12-22 04:16:18
问题 Flash is known to behave in very unpredictable ways ways when it comes to manipulating data. I'm curious that if there is any performance/memory benefit to using Numbers instead of ints aside from values that need precision. I have heard that some basic operations in Flash may convert multiple times between the two type to resolve the expression. I've also heard that Flash runtime, under the hood, actually maps ints to non-precision Numbers/Floats during runtime. Is any of this true? 回答1:

Check if value is a number

拈花ヽ惹草 提交于 2019-12-22 03:46:39
问题 How can i simply check if a returned value of type int or uint is a number? 回答1: Simple: if(_myValue is Number) { fire(); }// end if [UPDATE] Keep in mind that if _myValue is of type int or uint , then (_myValue is Number) will also equate to true . If you want to know if _myValue is a number that isn't an integer(int) or unsigned integer (uint), in other words a float, then you can simply modify the conditional as follows: (_myValue is Number && !(_myValue is int) && !(_myValue is uint)) Let

Large File Download

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-22 03:15:50
问题 Internet Explorer has a file download limit of 4GB (2 GB on IE6). Firefox does not have this problem (haven't tested safari yet) (More info here: http://support.microsoft.com/kb/298618) I am working on a site that will allow the user to download very large files (up to and exceeding 100GB) What is the best way to do this without using FTP . The end user must be able to download the file from there browser using HTTP. I don't think Flash or Silverlight can save files to the client so as far as

Flash/ActionScript: Draw a display object “onto” another

依然范特西╮ 提交于 2019-12-22 01:43:36
问题 How do I properly draw one vector object onto a specific position of another in ActionScript, accounting for positioning, transparency, etc? My idea (as suggested e.g. here) was to use beginBitmapFill () and drawRect () to draw a bitmap copy (made using BitmapData.draw ()) of one MovieClip onto the . graphics property of the other MovieClip, but this proved more difficult than I thought, mainly for these reasons: Transparency is not preserved : where the source MovieClip is transparent, the

How to dynamically set print page margins in Flash CS3

99封情书 提交于 2019-12-22 00:29:51
问题 //I can get the right margins by defining a rectangle and giving it the following dimensions: var rect1:Rectangle = new Rectangle(0, 0, 792,612); //When the print button is pressed the following code executes using the dimensions defined by rect1: prntCover_btn.addEventListener(MouseEvent.CLICK, printCover); function printCover(evt:MouseEvent):void { front_mc.visible = false; var myPrintJob:PrintJob = new PrintJob(); var options:PrintJobOptions = new PrintJobOptions(); options.printAsBitmap =

Converting Flash Animation to Cocos2D

我的未来我决定 提交于 2019-12-22 00:27:44
问题 Abstract What I require is a technique, given a single, but layered Flash animation, to export the position and rotation of each key movie clip in every frame as XML. Code to read in this information into a cocos2d-ready format would save a lot of time but isn't necessary as I know how to achieve this. Our artists often draw vector using Flash and have wonderful and impressive animations. Our technique in the past to put this art into our games is to export the separate animations as a

Dynamically Creating Flex Components In ActionScript

你说的曾经没有我的故事 提交于 2019-12-22 00:15:24
问题 Isn't there some way to re-write the following code, such that I don't need a gigantic switch statement with every conceivable type? Also, if I can replace the switch statement with some way to dynamically create new controls, then I can make the code smaller, more direct, and don't have to anticipate the possibility of custom control types. Before: <?xml version="1.0" encoding="utf-8"?> <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical"> <mx:Script> <![CDATA[

Any tools/libraries to convert ppt and pdf files to flash swf on server side?

假如想象 提交于 2019-12-22 00:08:45
问题 I'm building a pet project which needs to convert pdf and ppt files to flash swf files on the server side. This should look similar to what Scribd, Docstoc or Slideshare these websites do. But after some googling, I couldn't find any open source tools or libraries to do this except the OpenOffice wrapper. So I'm wondering how those websites do it or maybe there are some tools/libraries I don't know? Thanks, Wei 回答1: Convert your ppts into pdfs. And then use swftools for converting pdf (using

Adobe AIR SharedObject - Android/iOS - On update not found

孤街浪徒 提交于 2019-12-21 23:47:45
问题 As the title states, my user's on iOS and Android are reporting their save data has been deleted when I push an update to the respected storefronts. The game saves and restores data properly on application load and exit. I have not changed any save information locations or package names... Just mere bug fixes, build, push. Any clarification would be helpful, or proposed redundant data backup scheme's I should pursue to ensure the end-user experience is from henceforth not affected negatively.

Persistent connections between Flash client and Java server

不打扰是莪最后的温柔 提交于 2019-12-21 23:44:58
问题 I'm new to Flash. I'm planning to create a game client in Flash (running in browser) that needs to talk to a server written in Java. Connection between client and server needs to be persistent. I'm aware of XMLSocket - is that the only way to go? Any recommendations? Thanks! 回答1: There's a Socket class, which lets you use real TCP when talking to a server. Downside - you'll have to implement the protocol yourself (that's implementing HTTP client in most cases. Maybe somebody already did it)