actionscript-3

Flex Timer example

老子叫甜甜 提交于 2019-12-23 05:33:05
问题 I am trying to use timer in flex. I referred to this example : Timer : blog.flexexamples.com. Here is what I want to achieve: I want to start the timer, showing minutes elapsed since timer started. It should be independent of the region you are in.( irrespective of whatever zone you are in, timer should work fine in every zone). Timer should continue, unless some button is clicked, where I want to show the time elapsed in minutes, in an Alert Box and then timer should start again from 0

Flex Timer example

孤街浪徒 提交于 2019-12-23 05:33:04
问题 I am trying to use timer in flex. I referred to this example : Timer : blog.flexexamples.com. Here is what I want to achieve: I want to start the timer, showing minutes elapsed since timer started. It should be independent of the region you are in.( irrespective of whatever zone you are in, timer should work fine in every zone). Timer should continue, unless some button is clicked, where I want to show the time elapsed in minutes, in an Alert Box and then timer should start again from 0

Flash AS3 KeyboardEvent not firing

喜欢而已 提交于 2019-12-23 05:31:27
问题 I have a class like this: public class GameOverScreen extends MovieClip { public function GameOverScreen(useMouseControl:Boolean) { if(useMouseControl){ Mouse.show(); restartButton.addEventListener(MouseEvent.CLICK, onClickRestart); } else{ this.addEventListener(KeyboardEvent.KEY_DOWN, onPushSpace); } } public function onClickRestart(mouseEvent:MouseEvent):void{ dispatchEvent(new NavigationEvent(NavigationEvent.RESTART)); } public function onPushSpace(keyboardEvent:KeyboardEvent):void{ trace

Problems with stage.displayState (it's null even after assignments). Fullscreen AS3

家住魔仙堡 提交于 2019-12-23 05:28:08
问题 Relevant things: I had fullscreen code working before I did a security update on the flash player. Nevertheless, I still can fullscreen Youtube right now I'm doing the fullscreen activation in response to user clicks (therefore no security is blocking it AFAIK) stage.displayState is null all the time, in the main timeline and even after assignments below. Relevant code: 1) Set on the main timeline: stage.scaleMode = StageScaleMode.SHOW_ALL; stage.align = StageAlign.RIGHT; 2) Set when a user

How do I make my hitTestObject() more precise?

随声附和 提交于 2019-12-23 05:22:26
问题 I'm doing some collision detection with a circle and a square and whenever the circle comes in contact with the square it bounces away changing its X coordinate by *-1. However, the Hit Area of the circle is a square, so even when it collides with the white area around the circle , the affect still occurs. My question is, is there a way to modify the hit area to closer resemble my circle? Thanks 回答1: Bitmap hit testing is pixel based (instead of boundary-based, like Sprite-based hit testing),

Targeting multiple MovieClips which have the same instance name

元气小坏坏 提交于 2019-12-23 05:19:49
问题 On the stage, I have 3 MovieClips who have the same instance name, which is zeroMC but all three are an instance of different MovieClips. The first zeroMC is an instance of blank1,the second zeroMC is an instance of blank2 and the third zeroMC is an instance of blank3. I want to make all three movieclips gotoAndStop at 2, but when I do zeroMC.gotoAndStop(2); only one goes to and stops at 2. I also tried var containers = [zeroMC, zeroMC, zeroMC]; for (var i:int = 0; i<containers.length; i++) {

Send objects from flex to java servlet

老子叫甜甜 提交于 2019-12-23 05:15:39
问题 This is my method in actionscript var urlVars : URLVariables = new URLVariables(); urlVars.myname = byteArr; var urlReq : URLRequest = new URLRequest('MyServlet'); urlReq.data = urlVars; urlReq.method = 'post'; navigateToURL(urlReq, '_blank'); How do I recieve the byte array on servlet ? Also the byteArr above comes from java side, byte[] byteArr = aMethodWhichReturnsaPDFByteArray(); HttpServletResponse response = FlexContext.getHttpResponse(); ServletOutputStream os = null; try { response

How to use a method of a class inside a callback function in actionscript?

纵然是瞬间 提交于 2019-12-23 05:12:17
问题 When you call a method of a class inside a callback function, you can not use this object. To call the method, in javascript, I declare that variable, assign this to that , and use that inside the callback to call the method of this . In actionscript, do I have to do the same way as I do in javascript? The following code is the example to use that to call a method inside callback. Are there more simple way in actionscript? class C { private var that:C; function C() { that = this } public

Action Script 3 XML date format

≯℡__Kan透↙ 提交于 2019-12-23 04:56:48
问题 I am creating an XML based screensaver using Flash CS3, everything works fine. However, on the XML output file the date output format remains unformatted ( YYYY-MM-DD T00:00:00+00:00 ). Ideally, a UK date ( DD/MM/YYYY ) format would be output. Below is a sample of the ActionScript code driving an XML file // Load up variables with XML element data var item_data:Array = new Array(); item_data[0] = xml_item.id; item_data[1] = xml_item.Product_Name; item_data[2] = xml_item.Product_Language; item

How to convert different line of a dynamic text box to Movie clip in AS3

梦想的初衷 提交于 2019-12-23 04:50:19
问题 I have a question regarding to my project which is How to convert different line of a dynamic text box to Movie clip in AS3? Actually, I have an text file named test.txt. For instance: It consists of: today is Sun; today is Mon; today is Tue; today is Wed; today is Thu; today is Fri; today is Sat; and then I want to put all of them into an array and then a string to show them in the dynamic text Box called text_txt. I have different objects in my library. If we see "sun" in the first line,