actionscript-3

AS3: Importing classes/Sharing variables between classes

三世轮回 提交于 2020-01-06 19:10:28
问题 Ok, this is my problem: i have a variable in a class named Mirror public var line:Sprite = new Sprite(); i want to use that variable in another class named MovieClip. I imported the class in the MovieClip class: public class MovieClips extends MovieClip { import Mirror; public function MovieClips(radius:int, _x:int, _y:int,size:int,span:int,addl:Array) {.... but when i try to do something like this: if (Mirror.line.hitTestObject(ball) == true) { speedY *= -1; } It shows up like an error:

Why wont this move effect work on my sprites when the fade effect does?

╄→гoц情女王★ 提交于 2020-01-06 17:56:02
问题 Could someone please explain why this doesn't want to work? It's a bit of decoration to go behind a logo. When the dMove var is commented out I get the appropriate line of squares fading in and out at random spots along the x = 78 axis, but when introduced nothing appears at all... private var floatBG:UIComponent = new UIComponent(); private function addDP(event:TimerEvent):void{ var dY:Number = 5+Math.ceil(Math.random()*60); var dSize:Number = Math.ceil(Math.random()*12); var dAlpha:Number =

Forward MouseEvent in transparent bitmap to underlying MovieClip

删除回忆录丶 提交于 2020-01-06 16:52:06
问题 So I'm Bitmaping some heavy stuff to try bring down the [pre-render] and [render] which is quite high according to FlashBuilder's profiling. I thought this was going well until I realised that as soon as you change a MovieClip to a Bitmap, you lose the pixel based accuracy of the mouse move events (Over, Out, Move...), all your left with is the entire bounding box of the Bitmap, something which is less than desirable. I've got a game where many Bitmapped assets would be on top of each other

Forward MouseEvent in transparent bitmap to underlying MovieClip

China☆狼群 提交于 2020-01-06 16:51:56
问题 So I'm Bitmaping some heavy stuff to try bring down the [pre-render] and [render] which is quite high according to FlashBuilder's profiling. I thought this was going well until I realised that as soon as you change a MovieClip to a Bitmap, you lose the pixel based accuracy of the mouse move events (Over, Out, Move...), all your left with is the entire bounding box of the Bitmap, something which is less than desirable. I've got a game where many Bitmapped assets would be on top of each other

Box2D: How to get the position of a sensor?

我怕爱的太早我们不能终老 提交于 2020-01-06 16:50:50
问题 Edit I've updated this question here: Box2D: How to get the position of a static body? I'm using sensors in a Box2D project. On a collision with a sensor, I'd like to know the sensor's position in the world. I'm detecting the collision with a contact listener, but the sensor's position is always 0 0. From my code: (edit, added the whole class) public class MyContactListener extends b2ContactListener { public var onSensorEvent:Function; override public function BeginContact(contact:b2Contact)

Is there a way to get https requests to work when calling from a localhost for testing

不羁的心 提交于 2020-01-06 15:44:06
问题 I'm getting the errors when testing my application locally since I switched to https: Warning: Domain www.example.com does not specify a meta-policy. Applying default meta-policy 'master-only'. This configuration is deprecated. See http://www.adobe.com/go/strict_policy_files to fix this problem. Error: Request for resource at https://www.example.com/?json=user/get_logged_in_user by requestor from http://localhost:8888/Test-debug/Test.swf is denied due to lack of policy file permissions. I

Flash loading first external swf loaded

旧时模样 提交于 2020-01-06 14:51:12
问题 I am making an application to test art from a game I volunteered for. Right now the example I am posting will only touch the armors but the loading process is the same throughout the program. I have a movieclip ready to hold the loaded file but it adds it to the container via the class. It works how it should however my issue is that if you use another file with the same classes then it will default to the first file loaded. Even i use loaderr.unloadAndStop() and remove everything from the

AS3 can not load a Bitmap by using loadByte in Thread?

点点圈 提交于 2020-01-06 14:48:09
问题 Flash Player supported Thread in 11.5+. I want to load an image by using Loader.loadBytes() in Worker Thread. Which the Image ByteArray are generated in Main Thread. But I can NOT do it. I got a SecurityError like this: SecurityError: Error #2123: Security sandbox violation: Loader.content: file:///E:/work/ASWorkSpace/test/bin-debug/test.swf cannot access file:///E:/work/ASWorkSpace/test/bin-debug/test.swf/[[DYNAMIC]]/1. No policy files granted access. I init my worker thread like: worker =

ActionScript 3.0 - Dispatch event class to class

拥有回忆 提交于 2020-01-06 14:38:10
问题 I'm working in Action Script 3.0 and I have a question in DispatchEvent class. following code is standalone class. I want to dispatch event to 'main' class and 'sub' class when event occured. I'm stuck on this issue. please help me. package com { import flash.events.*; import flash.display.MovieClip; import com.sub; public class main extends MovieClip { public static const BTN_CLICKED:String = "btn_Clicked"; public function main():void { if (stage) init(); else addEventListener(Event.ADDED_TO

scrolling interval in a Spark List with Tilelayout oversized while using mouse wheel after scrolling with mouseclick

末鹿安然 提交于 2020-01-06 14:27:16
问题 I have a spark List with an item renderer and a tile layout. If I scroll by clicking with the mouse on the scroll bar and trying to scroll with the mouse wheel after that, there is a problem: The interval of the scrolling is oversized, instead of scrolling one item down (or up) the List scrolls 4 items down (or up). <s:List dataProvider="{myDataProvider}" itemRenderer="MyRenderer" left="11" right="11" bottom="3" top="10" useVirtualLayout="false" > <s:layout> <s:TileLayout columnAlign=