actionscript-3

2D Platform Game using hitTestPoint:glitches

半腔热情 提交于 2019-12-25 03:10:23
问题 So I created my own code for a 2d platform game (like Mario). I decided to use the hitTestPoint method to handle my collisions. It worked smooth as butter, and everything was working perfectly. The character could move up and down ramps perfectly. My next step in creating my game would be to change my character (which was a block at the time) into a human character that can go to frames labeled "walk", "jump" and "stand". After creating variables for the two character states "run" and "stand"

AS3: Embedding characters

拜拜、爱过 提交于 2019-12-25 03:09:01
问题 I having some trouble with TextFields and caracter embedding. As I have understood, the way to embed character in Flash, is to have a TextField in a movieclip that is exported to actionscript via some classname. Then have the TextField embed the characters. But when i try to use that TextField in my project, I cannot auto resize the field any longer!? Is there a better way to embed charactes? or am I missing some unknow attribute? (and yes i have tried TextField.autoSize = "left" (or "center"

Error Referencing Externally loaded SWF

家住魔仙堡 提交于 2019-12-25 03:08:42
问题 I'm loading an swf say "test.swf" which gets loaded in imageLoader , so I can get its content by : imageLoader.content So if I wanted one of the movieClips inside it I would do this : imageLoader.content.testMovie.transform.colorTransform = someTransformation; But when I do this, since the movie is not loaded the file is not compiled and gives me an error your referring to something that is not there. How else am I supposed to reference a content that will be loaded later? 回答1: Wait till it

Using “Import” AS3

ε祈祈猫儿з 提交于 2019-12-25 03:08:29
问题 I´d like to know. What exactly does 'import'? I´m thinking about to use a flash component with this 'import': //import the required data class import fl.data.DataProvider; //import the AutoComplete class import com.yahoo.astra.fl.controls.AutoComplete; I mean, I don´t have those folders in my app main folder. Is it importing from web? If yes, is it safe? If server is shut down, will the app, that uses those classes, crash? Thanks. 回答1: With the import statement you can include certain

What [object global] is exactly, when “this” is accessed inside a nested or inline function?

为君一笑 提交于 2019-12-25 03:05:42
问题 Here is the code: package { import flash.events.*; import flash.display.*; public class SomeDocumentClass extends MovieClip { public var abc: MovieClip; public var test_var = 12345; public function SomeDocumentClass() { //abc is an instance name of a movieclip placed on stage abc.addEventListener(MouseEvent.CLICK, function () { trace(this); }); abc.addEventListener(MouseEvent.CLICK, abc_CLICK) } function abc_CLICK(e: Event): void { trace(this); } } } The output is : [object global] [object

How I get all the children nodes from Xml data? [duplicate]

老子叫甜甜 提交于 2019-12-25 03:00:24
问题 This question already has an answer here : Closed 7 years ago . Possible Duplicate: how I get child node from each parent node seperately? I have Some XML data..I want to create certain component based on this XML.My XML data is given below <main> <TabNavigator x="27" y="11" width="455" height="376" id="gh" backgroundColor="#A4B6E9"> <NavigatorContent width="100%" height="100%" label="Client" id="clientTab"> <Label x="10" y="30" width="52" height="25" text="Name:"/> <Label x="10" y="127"

Dynamically Casting In ActionScript

泪湿孤枕 提交于 2019-12-25 02:57:15
问题 Is there a way to cast dynamically in Actionscript? What I want to accomplish is illustrated by the following code: var Val:*; var S:String=SomeTextEdit.text; switch (DesiredTypeTextEdit.text) { case 'int':Val=int(S);break; case 'uint':Val=uint(S);break; case 'String':Val=String(S);break; case 'Number':Val=Number(S);break; ... } SomeDisplayObject[SomePropertyNameTextEdit.text]=Val; I am looking for something LIKE the following PSEUDOCODE: SomeDisplayObject[SomePropertyName]=eval(DesiredType)

Facebook API 100 Error

久未见 提交于 2019-12-25 02:57:04
问题 Been receiving this error when trying to post on a feed. I am using JavaScript to post. The ByteArray data is coming from a .swf API Error Code: 100 API Error Description: Invalid parameter Error Message: picture URL is not properly formatted Here is my AS3: var bdToSave:BitmapData = new BitmapData(s.width, s.height); bdToSave.draw(s, null, null, null, null, true); var encoder:JPGEncoder = new JPGEncoder(); var byteArray:ByteArray = encoder.encode(bdToSave); if (ExternalInterface.available)

How to calculate CRC checksum in Actionscript 3?

倾然丶 夕夏残阳落幕 提交于 2019-12-25 02:55:57
问题 I am developing an application in flex in which I need to calculate checksum of different files. I would like to know if there is a direct method in actionscript to calculate that or do I have to go for any external libraries? Thanks in advance :) 回答1: as3corelib maintained by Mike Chambers/Adobe, contains everything you probably need in its crypto section including: HMAC MD5 MD5Stream SHA1 SHA224 SHA256 WSSEUsernameTocken 回答2: how do you use this as3corelib to perform a md5 on a file i.e. "c

Strange behavior with variable

烂漫一生 提交于 2019-12-25 02:53:38
问题 There is very strange problem with variable in action script. I use it (variable) to dinamically change width of progress bar in my mp3 player, here is code: filledProgress.width = Math.round (progressPercent * 1.56); it works very good in the beginning, but after some time it stops, by stops I mean, filledProgress.width doesn't want to change its value from 0, although on the right part of expression is always some result, I even created different variable, to check whether it will get value