actionscript-3

AS3 Character jumping/falling problems

与世无争的帅哥 提交于 2019-12-25 06:59:32
问题 I am having problems with getting the character to jump/fail when the up arrow is pressed. I'm trying to make it so when the up arrow key is pressed once it will jump a certain height then fall. Here is my movement code: public var gravity:int = 2; public function fireboyMovement(e:KeyboardEvent):void { if (e.keyCode == 37) //right { fireboy1.x = fireboy1.x -5; checkBorder() } else if (e.keyCode == 39) //left { fireboy1.x = fireboy1.x +5; checkBorder() } if (e.keyCode == 38) //up { fireboy1.y

How could I compile the code for this Flash tutorial?

时间秒杀一切 提交于 2019-12-25 06:59:01
问题 I started reading this tutorial: http://active.tutsplus.com/tutorials/actionscript/creating-a-reusable-flash-uploader-with-actionscript-3-0-and-php/ I'm using FlashDevelop, and I pasted the full code into an ActionScript file. The errors I'm receiving are like this: C:\Users\tempus\Documents\uploaderas\Uploader.as(30): col: 4 Error: Access of undefined property select_btn. select_btn.addEventListener( MouseEvent.CLICK, browse ); ^ C:\Users\tempus\Documents\uploaderas\Uploader.as(31): col: 4

What are some methods that Flash apps can communicate with each other?

十年热恋 提交于 2019-12-25 06:56:11
问题 I'm developing an interactive system where two client flash apps will talk to a third server app. The clients will be sending some status information to the server. I think I need two way communication...haven't decided whether the server needs to send back any acknowledgements yet. These will be applications and not .swfs that run in a browser. So far the only method that I see are to make the server an AIR app (b/c AIR has a Server Socket class) and make the clients Flash projectors (b/c

finding sequences in AS3 array

不羁的心 提交于 2019-12-25 06:52:10
问题 does anyone have any idea what to do in order to find the number of sequences in an array? for example, my array is: var numbers:Array = new Array(banana, banana, apple, banana, banana); and i need to find is: * how many times there is a sequence of "banana" * and the length of each sequence. what shell i do in order to get the following result: 2,1,2 (2 bananas, 1 apple, 2 bananas) i tried with do while loop, but i i guess i miss something. a short example will be very appreciated! thanx 回答1

Adobe Air : StageWebView inside MovieClip

巧了我就是萌 提交于 2019-12-25 06:48:09
问题 I have a simple question. I want to have a StageWebView inside a MovieClip so if the MovieClip is moved, the Stage is moved to. var view:MovieClip = new MovieClip(); view.y=50; view.x=10; view.height=stage.stageHeight-50; view.width=stage.fullScreenWidth; addChild(view); var webView:StageWebView = new StageWebView(); webView=new StageWebView(); webView.stage=view.stage; webView.viewPort=new Rectangle(0,0,stage.fullScreenWidth,stage.stageHeight); webView.loadURL("http://www.google.com/"); Even

XML - targeting node attribute, push into a Flash AS3 array

♀尐吖头ヾ 提交于 2019-12-25 06:36:13
问题 I'm trying to push just the contents of the "txt" attribute in each "question" tag into an array named "questions" in AS3 Flash. Here is an excerpt from my xml file. <question id='Q1' uId='99036' no_ans='2' txt='In a flat structure employees are not expected to provide their bosses with their opinions.' feedback='' type='MC' passingWeight='1' url='media/'> <answer id='Q1A1' uId='311288' txt='True' weight='0'/> <answer id='Q1A2' uId='311289' txt='False' weight='1'/> </question> <question id=

How to properly use .SWC packages in Flash CS 4

为君一笑 提交于 2019-12-25 06:35:00
问题 I've googled a lot trying to find how to properly import and use .swc files in Flash CS 4, tried lots of different methods but none seem to work. What I've done is: 1. Placed it in my "D:\Program Files (x86)\Adobe\Adobe Flash CS4\en\Configuration\Components" folder. It does however not show up in the component inspector. 2. Added it in Publishing Settings as a Library and External Library, still can't seem to use it. I've also tried adding "import org.osflash.signals;" after each method but I

Converting 2x32 bit uint <-> Number

江枫思渺然 提交于 2019-12-25 06:33:41
问题 How would one convert from 2x32bit uints to a Number and back (assume max value of 2^52)? I believe the following would theoretically work (passing around as ByteArray for clarity, but an Array could work as storage as well), But it doesn't because bitwise operators evidently force Number into 32 bits :\ (see: Binary math on Number objects limited to 32 bits?): public static function read64BitNumberFromBuffer(buffer:ByteArray):Number { var ch1:uint = buffer.readUnsignedInt(); var ch2:uint =

Writing to CSV file in AS3

半腔热情 提交于 2019-12-25 06:29:19
问题 I have looked far and wide but I can't find any resources on how to write to CSV files from flash AS3. I know that flash cannot write to it alone. I have used PHP before to write to a txt file but now I need to open a csv and insert/edit entries that are already in it. How can I do this? 回答1: There is no built in support for CSV, although it can be done manually: //dummy data var data:Array = []; for(var i:int = 0 ; i < 100 ; i++) data[i] = {a:Math.random() * 100,b:Math.random() * 100,c:Math

AS3 error text linkage to xml

一曲冷凌霜 提交于 2019-12-25 06:23:26
问题 SO i was testin various ways for linkage dynamic scrolling text and xml file i wanted to put on stage double text sliders each of them will fetch different data from xml file but getting random error here is the code: //SCROLLING SPEED var scrolling_speed:int = 2; var scrolling_speed2:int = 4; //TEXT TO SCROLL var text_to_scroll:String = "www.posta.ba"; var xmlLoader: URLLoader = new URLLoader(); var myData: XML; var myItems: XMLList; var position: uint; xmlLoader.addEventListener(Event