actionscript-3

posting message on Facebook wall via flash/ActionScript

我怕爱的太早我们不能终老 提交于 2020-01-06 06:03:25
问题 I am creating a game that needs to be integrated with Facebook. The game is done and once the user complets that game it adds the button that send score to the Facebook wall of the user. I have downloaded the Facebook api for flash and is able to connect to the user and get its id. But I don't know what command to use to post the score or message on users wall via swf. Below is the basic codes... import com.facebook.data.users.GetInfoData; import com.facebook.utils.FacebookSessionUtil; import

The text around the center of the circle along the radius

☆樱花仙子☆ 提交于 2020-01-06 05:49:06
问题 Please help to solve the geometric issue. I'm creating multiple sectors of the wheel. Now I need to be placed in every sector the text oriented from the center of the circle to the edge. But somehow, everything goes awry. Here is the class of one sector: package comps { import flash.display.Shape; import flash.display.Sprite; import flash.filters.GlowFilter; import flash.geom.Matrix; import flash.geom.Point; import flash.geom.Vector3D; import flash.net.URLRequest; import flash.text

Error #1034 while running flash application

好久不见. 提交于 2020-01-06 05:39:30
问题 Alright, I know that this error is occurring because of something to do with addchild() function. On frame 2. How do I know? Because when I remove the snippets of code that dynamically place an object onto the stage it works fine. The error is below and the source code for frame 2 is below the error messages. Error Code TypeError: Error #1034: Type Coercion failed: cannot convert 0 to flash.display.DisplayObject. at fl.motion::AnimatorBase/play() at fl.motion::AnimatorBase$

AS3 Using multiple timer to show / hide enemies

无人久伴 提交于 2020-01-06 05:39:14
问题 i have a shooting game that works with some sort of rounds, for instance, this round is gonna show 4 enemies on the screen that the user has to shoot. I show the 4 enemies at a half seconds interval of each one so it doesnt all appear on the same time. Using something like: enemiesShowTimer = new Timer(0.5 * 1000, 1); enemiesShowTimer.addEventListener(TimerEvent.TIMER, showEnemyAtTime); enemiesShowTimer.start(); The player has 2 seconds to kill each enemy after they appear, so i also use this

Loaded swf doesn't appear when referencing one of its control by string

好久不见. 提交于 2020-01-06 05:25:29
问题 I have in main: var MyLoader:Loader = new Loader(); MyLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, finishLoading); MyLoader.load(new URLRequest("MySWF.swf")); MyZone.addChild(loader); And in MySWF: this["aSlider"].addEventListener(SliderEvent.CHANGE,OnSliderChange); then MySWF doesn't show up on stage whereas with aSlider.addEventListener(SliderEvent.CHANGE,OnSliderChange); it does appear. I need to use this["aSlider"] because of this http://blog.ickydime.com/2008/07/as3-notes

How to relay complex type via NetConnection to FMS?

那年仲夏 提交于 2020-01-06 04:56:45
问题 I need to send complex type object (marked RemoteClass in Flex) via NetConnection to other clients. [RemoteClass] public class ComplexType { public var _someString:String; public var _someInt:int; } ... and using ... _nc = new NetConnection(); _nc.connect("rtmp://localhost/echo/"); _nc.addEventListener(NetStatusEvent.NET_STATUS, _onNetStatus); _nc.client = {}; _nc.client.echoCallback = _echoCallback; var dto:ComplexType = new ComplexType(); dto._someInt = 4; dto._someString = "abrakadabra";

how does flash handle garbage collection when it comes to adding movieclips directly to another

家住魔仙堡 提交于 2020-01-06 04:46:09
问题 Just curious, If i nest a movieclip inside of another movieclip, and the nested movieclip is attached to a custom class. And that custom class has a Event.ENTER_FRAME listener. when I destroy the container movieclip, will flash get rid of the event listeners inside of nested movieclip's custom class ? May seem like a silly question but flash has a tendency of not killing listeners along with the movieclip itself once it is removed from the stage(this is if your apply the movieclip via

Sending ByteArray to Zend_Amf

我只是一个虾纸丫 提交于 2020-01-06 04:33:30
问题 I'm having problems sending a ByteArray over to my Zend_Amf_server. I get a NetConnection.Bad.Call back from the server. If I send a variable with another datatype then ByteArray it works fine. I used the same script before with AMFPHP witouth any problems. But for this project I really need this to work in Zend_Amf. AS3: var path:String = "/images/picture.jpg"; var ba:ByteArray = jpgencoder.encode(bitmap.bitmapData); var nc:NetConnection = new NetConnection(); nc.connect(zend_amf_server); nc

AS3- create a loopable random path in 3D space

柔情痞子 提交于 2020-01-06 04:12:05
问题 I'm trying to optimize a 3d demo by populating a lookup table with 3d points(Vector 3D http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/geom/Vector3D.html) which I will then access later on. These 3D points will define a random and loopable path in 3D space. Does anyone know a way of achieving this? I was thinking modifying the Greensock Bezier tween to create a bezier in 3d space, and then somehow grabbing the xyz values of the resulting tween. 回答1: Ok, you'll need to

AS3 Global class that can add objects to stage

我的未来我决定 提交于 2020-01-06 03:30:31
问题 So I recently learnt that by importing a class into my main class I can access its functions from any other class. BUT.... one of my functions in the imported class needs to add display objects to the stage. I accessed the static function just fine but it can't add objects to the stage. It doesn't even seem to recognise addChild. Is this because it is not in the display list itself? What am I missing here? How would you guys solve this issue. I was so close, yet so far! Code is like this: