actionscript-3

Starling library - Sprite dissapeared from stage and I don't know why

匆匆过客 提交于 2019-12-24 21:44:47
问题 The code for the question is here - I am using Flash Builder 4.7, I will also post all the relevant code now: Game.as (might be something wrong here) package { import Classes.AvatarEnemy; //import starling.animation.Juggler; //import starling.core.Starling; import starling.display.Sprite; import flash.geom.Point; import flash.display.Bitmap; import flash.display.BitmapData; import flash.ui.Mouse; import flash.ui.MouseCursorData; public class Game extends Sprite { //private var juggler:Juggler

Creating a multiline label inside a custom togglebuttonbar

徘徊边缘 提交于 2019-12-24 21:22:06
问题 i have a custom toggleButtonBar class that allows label placement on the button, however, i would like to have the labels to be multiline. I'm not good at extending default components. Is there anyone that can help me out? package com.vit2print.plugin.transvit.tools { import mx.controls.Button; import mx.controls.ToggleButtonBar; import mx.core.IFlexDisplayObject; public class IconToggleButtonBar extends ToggleButtonBar { [Inspectable(enumeration="left,right,top,bottom", defaultValue="left")]

Read Flex/Flash URL which has Transfer-Encoding chunked

感情迁移 提交于 2019-12-24 21:10:38
问题 I have a problem reading from Flex a url which has Transfer-Encoding: chunked because the FLex waits for the server to send terminate signal which in chunked transfer isn't sent... 回答1: Use the URLStream class instead of whatever loader you're using now. Its ProgressEvents will let you read chunks before the message completes. 回答2: But if you read the documents a little more carefully, you will find the following. So it becomes clear, you just need to check the size of received chunks until

actionscript 2 to actionscript 3

倖福魔咒の 提交于 2019-12-24 20:52:21
问题 so I have a lot of classes in actionscript 2. But I need to modify my application to use the soundchannel object for audio monitoring. as far as i know this is only in actionscript 3. so it it possible to write one class in AS3 and leave the rest in AS2? if not is there a conversion tool which can make the process easier? 回答1: The language the ActionScriptBridge site uses is sort of misleading: "Use flash AS2.0 flash components in AS3.0 projects." And then tells you how it works: "Technically

In AS3, where do you draw the line between Dictionary and ArrayCollection?

♀尐吖头ヾ 提交于 2019-12-24 20:36:51
问题 Basically I have been using a Dictionary object in my program that basically took ints as its keys and stored RTMFP peer IDs in the appropriate locations. Each int was unique and represented one user. Now I'm needing to expand on this where users are identified by a combination of the int and a Boolean value, kind of like this: private var m_iUID:int; private var m_blnIsCurrent:Boolean; Only the combination between those two really uniquely identifies the user. That being said I was just

as3 dynamic button name capturing problem

守給你的承諾、 提交于 2019-12-24 20:32:02
问题 i am using this code below to dynamically capture the name of the button pressed and then playing the related balloon movie clip animation. stage.addEventListener(MouseEvent.CLICK, player); function player(evt:MouseEvent){ var nameofballoon = evt.target.name; nameofballoon =nameofballoon.substring(nameofballoon.length-1,nameofballoon.length); var movie = "balloon"+nameofballoon; trace(movie); movie.gotoAndPlay("burst"); } i'm getting this error even though the name of the clip capture by the

Is it possible to store an Array into an EncryptedLocalStore item? AIR

橙三吉。 提交于 2019-12-24 20:27:10
问题 I want to save my Array's strucure and load it the next time I open my AIR application. Is there a way to store it to an EncryptedLocalStore item then get it later when I re-open the app? 回答1: EncryptedLocalStore.setItem() method takes a byte array when storing contents. To store an array, just use ByteArray.writeObject() method (as described in http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/utils/ByteArray.html#writeObject()) to convert your Array to a ByteArray -

Add layout to Flex UIComponent

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-24 20:14:15
问题 How can I add a layout (a HorizontalLayout to be specific) to a Flex UIComponent? I'm working on a large mobile application, hence I'd like to avoid using additional containers like HGroups and work with more lightweight components. As usual, any help would be greatly appreciated! 回答1: You can't and you don't really need to. You can't, because only Spark components were designed with an encapsulated layout mechanism. mx components were not and you can't assign a layout to UIComponent. You don

When a SWF is loaded into another. Can the main SWF read the loaded one to retrieve its contents and modify them?

我只是一个虾纸丫 提交于 2019-12-24 20:12:07
问题 Give this scenario: I have a cool graphic in Illustrator or Flash. The graphic represents a figure, with various elements inside, shapes, lines, gradients, etc. I export it to a swf file and I can view my nice graphic if I open it. I have a (pure) as3 application, which loads swfs. Then... Can I manipulate the contents of the loaded swf. For example: Moving its contents, changing some elements inside, duplicating them. Deforming them with the transform matrix and things like that? Can I, at

Get the time from XML using AS3

荒凉一梦 提交于 2019-12-24 19:59:59
问题 I have an XML file of various auction items that will display based on the time. I want to use AS3 to getUTCDate based on the hour set in the field of the XML file and then display the appropriate XML node. I'm pretty much intermediate with AS3+XML so I could use some help. I've got everything setup but something isn't quite right. AS3 Code: import flash.net.URLRequest; import flash.net.URLLoader; import flash.events.Event; import flash.text.TextFormat; var xmlData:XML = new XML(); var theURL