actionscript-3

How should I smooth the transition between these two states in flex/flashbuilder

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-06 03:11:09
问题 I have an item in which has two states, best described as open and closed, and they look like this: and And what I'd like to do is is smooth the transition between one state and the other, effectively by interpolating between the two points in a smooth manner (sine) to move the footer/button-block and then fade in the pie chart. However this is apparently beyond me and after wrestling with my inability to do so for an hour+ I'm posting it here :D So my transition block looks as follows <s

Why should compiler allow super-class of a parameter in a function

人盡茶涼 提交于 2020-01-06 03:08:04
问题 public class ChildClass extends MovieClip { public function ChildClass() { } public function aChildClassFunction() { } } public class AnotherChildClass extends MovieClip { public function ChildClass() { } public function aChildClassFunction() { } } Some random function that asks for childClass ( But a lazy programmer just uses MovieClip class ) public function setChildClassInstance(var mc:MovieClip) { // How come "mc" represent and be allowed as parameter ??? It's a super-class.. ie.

AS3 - Finding the highest y-coordinate for a given x-coordinate in BitmapData?

和自甴很熟 提交于 2020-01-06 02:59:07
问题 I'm making a platformer. Here is what I have so far: http://megaswf.com/s/2486396 (move around and jump with arrowkeys). I'm using the ground's bitmap data to test collisions with the player's coordinates, and the player is sinking into the ground a few pixels (especially when walking uphill). To prevent this, I want the player's y coordinate to instantly change so that the player is sitting on top of the ground. Here is what I'm working on: if (groundClipBmpData.hitTest(rLoc, 255, bLocFuture

AIR app, adding activity to manifest changes the app design

社会主义新天地 提交于 2020-01-06 02:52:08
问题 I have a small problem, probably because I'm a newbie in Android development. I am making an Air mobile App, with an Air Native Extension. My extension is used to create alarms. In my BroadcastReceiver I make an Intent to call my Air App. To make this call possible I had to add the activity in my Air App Manifest like this : <manifestAdditions><![CDATA[ <manifest> <uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.VIBRATE"/> <uses

ActionScript - XML/E4X Is Slow?

萝らか妹 提交于 2020-01-06 02:45:49
问题 i've been reading that XML/E4X is very slow with AVM2 / ActionScript 3. when supplying an application with XML data, is it always generally a better idea to parse the XML object into an array of objects to call rather than using E4X with the stock XML data? 回答1: Aside from the performance issue, it would be a good idea to decouple your application from the data source. Let's say , for example, that you'd like to use JSON in the future... It'd be more flexible to pass the XML data to an Object

write, update and save a well-formed xml file in as3

早过忘川 提交于 2020-01-06 02:44:13
问题 I am trying to update an xml file and save elements inside of an already saved root element. I have only found examples where the xml files are just opened and not saved. Can someone help me to find the best way to save the results? My project right now looks like this: I am loading an xml file via URLLoader/URLRequest and display the contents in several text fields. New text from an input field is saved (appended) via FileStream directly to the xml file in the applicationStorageDirectory

Flash AS3 Clone, Drag & Drop

大憨熊 提交于 2020-01-06 01:36:09
问题 I am a teacher and with the help of some of you, I managed to create very basic word game for kids where they are able to create words from letters. SWF | FLA I have, however, been unable to continue to drag and drop the letters once they have been cloned from their originals on the side of the stage. Is anyone able to advise how I might be able to add this functionality to my existing code? import flash.display.MovieClip; for (var i=1; i<27; i++) { this["object" + i].addEventListener

AS3 Accessing frame without using gotoAndStop

杀马特。学长 韩版系。学妹 提交于 2020-01-06 01:35:08
问题 Is there a way to access the image data (children/transformation info) of a particular frame in a MovieClip without having to use the gotoAndStop methods. These methods are part of a rendering pipeline, all I want is access to the data, not to start a chain of asynchronous events that were developed to render things on screen, call multiple event listeners and execute frame actions. 回答1: Not only can you not do that, but gotoAndStop() doesn't even immediately make that data available. The

Actionscript Receiving Mouse Events For Lower Indexed And Partially Covered Display Objects?

ぐ巨炮叔叔 提交于 2020-01-06 01:06:10
问题 i have 2 sprites on stage. bottomSprite is added to the display list first, followed by topSprite. topSprite partially covers bottomSprite. i've added an event listener to bottomSprite for MouseEvent.MOUSE_MOVED notifications to simply trace the mouseX and mouseY coordinates. however, the notification doesn't work for the parts of bottomSprite that are covered by topSprite. var bottomSprite:Sprite = new Sprite(); bottomSprite.graphics.beginFill(0x666666, 0.5); bottomSprite.graphics.drawRect

AS3 dynamically attach MovieClip from a library to the Stage

强颜欢笑 提交于 2020-01-05 19:36:52
问题 I really have searched high and wide and i'm starting to think it may be my terminology that is preventing me from finding the answer. I have a MovieClip in my library set to Export to ActionScript 3.0 with a Class called 'Info_Win' (its basically going to be a pop-up window, the contents of which depends on it's instance name). I will be adding a given number of these MovieClips to the main stage and each one has to be given a custom instance name that will allow me to access it once it's on