actionscript-3

zip file contents have no data

可紊 提交于 2020-01-17 05:01:05
问题 I have for a while been trying to make a zipping script. The closest I have come to what I am needing is this one. import flash.filesystem.File; import flash.events.Event; import FZIP.*; var directory:File = File.desktopDirectory.resolvePath("Test File"); var zip:FZip = new FZip(); var files:Array = directory.getDirectoryListing(); for(var i:uint = 0; i < files.length; i++) { var file_2:File = new File(files[i].nativePath); // zip.addFile(file_2.name, file_2.data); zip.addFile(file_2.name, ba

AS3 AIR RequestSoftKeyboard not working on Windows

和自甴很熟 提交于 2020-01-17 04:59:07
问题 I tried to launch a virtual keyboard on Windows using this: _txtInputName = new TextField(); _txtInputName.type = TextFieldType.INPUT; _txtInputName.needsSoftKeyboard = true; _txtInputName.addEventListener(FocusEvent.FOCUS_IN, onFocus ); private function onFocus(e:FocusEvent):void { _txtInputName.requestSoftKeyboard(); } Unfortunaly, the softkeyboard doesn't show up. Am I missing something? Does I have to add something on the application.xml? Thank you so much! 回答1: TextField is not an object

Adding a object randomly on the screen in as3

最后都变了- 提交于 2020-01-17 04:42:26
问题 OK, so i am having trouble with adding a box randomly on the screen. I have done this before and it seems like it should have a relatively easy solution. But alas, i have not been able to figure this out. This is the info: I have a box mc with exporting as Box. I have a Box Actionscript file with this code in it: package { import flash.display.MovieClip; import flash.events.Event; import flash.events.MouseEvent; public class Box extends MovieClip { public function Box() { createBox(); }

sortable grid like jquery ui in adobe flex

一曲冷凌霜 提交于 2020-01-17 04:14:26
问题 I need something like jQuery UI's Sortable in Adobe Flex. Is there a quick solution out there? 回答1: Here is similar sortable grid(3X3) example in flex: <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" verticalAlign="middle" horizontalAlign="center" height="100%" width="100%"> <mx:Script> <![CDATA[ import mx.containers.GridItem; import mx.controls.Button; import mx.core.DragSource; import mx.events.*; import mx.managers.DragManager; private var

zip many files with Air as3 flash

会有一股神秘感。 提交于 2020-01-17 04:12:55
问题 OK . I am reasonably capable, but still learning. This is for a program I am writing in AIR. Basicaly I am needing to grab the files of mixed type and content from a given folder and zip them. Here is the code I have put together and it sort of works. Problem I have is that the files in the zip all have zero byte's in them. Efectivly empty. What have I missed or done wrong? import flash.filesystem.File; import flash.events.Event; import deng.fzip.*; var directory:File = File.desktopDirectory

Tracing flash to a line which doesn't exist, flash CS5/AS3

醉酒当歌 提交于 2020-01-17 03:09:04
问题 I got an error on frame1:26. The code for this frame (the complete code) is below. The error message I get is is: TypeError: Error #1034: Type Coercion failed: cannot convert 0 to flash.display.DisplayObject. at fl.motion::AnimatorBase/play() at fl.motion::AnimatorBase$/processCurrentFrame() at fl.motion::AnimatorBase/handleEnterFrame() at flash.display::MovieClip/nextFrame() at Lemonade_fla::MainTimeline/begin()[Lemonade_fla.MainTimeline::frame1:26] If I'm reading this message correctly it

Using PNG/GIF Images as buttons using AS3

爱⌒轻易说出口 提交于 2020-01-17 03:07:30
问题 Friends, I am new to AS3 so pardon me. I am trying to use images as buttons (PNG/GIF images as buttons(simple, toggled and multi-state) - Image change on mouse over, normal and pressed) using AS3 only. I tried to search. All I got is to setting icon of a Button. It would be really great if you can share the code snippet or pointers. Thanks a lot. 回答1: There are ways to do this without converting an image to a Movieclip. You can either embed your images inside your SWF using the [Embed] tag...

AS3 move sprite along predefined curve

…衆ロ難τιáo~ 提交于 2020-01-17 02:21:48
问题 I want to make a circle(:Sprite) move along a pre-drawn curve. Using the graphics library a drew a 350 degree curve and I want my scrubber to move just from 0 degrees all tha way to 350 degrees without leaving the path. I found a great class from senocular.com that does this, but the problem is that Im limited to the lenght of the curve that I could use, since for it to work correctly I have to constrain myself to a maximum of a 90 degree curve. I also found another class that moves the

I need help in ActionScript3.0

放肆的年华 提交于 2020-01-17 02:20:41
问题 I am working on a time limit game, but when I load the game and it passes the time limit that is placed it reaches zero but it is not directed to the next scene where I have the game over .. this is the code that is placed var tiempo:int; var Duracion:int; Duracion = 7; tiempo = Duracion; var timer:Timer = new Timer(1000,Duracion); timer.addEventListener(TimerEvent.TIMER, tiempo2); timer.addEventListener(TimerEvent.TIMER_COMPLETE, fin) timer.start(); function tiempo2(tiempoevent:TimerEvent)

How much resources does an unremoved event listener consume?

谁都会走 提交于 2020-01-17 02:20:30
问题 Let's say I've got an event listener function that is listening for an event that will never be called again throughout the lifespan of the program. The listening object will never need to be garbage collected. How much memory does this use? If it's negligible, I'd rather not remove the listener because having the removeEventListener() statement makes my code less readable. 回答1: That depends entirely on how large and complex the listener is. In many cases, the memory impact is negligible,