actionscript-3

Using Forex Feed from XML in AS3?

大憨熊 提交于 2019-12-25 09:35:45
问题 I would like to use this xml file for currency exchange rates in my AS3 flash file: http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml So far, this is what I have: var myXML:XML; var myLoader:URLLoader = new URLLoader(); myLoader.load(new URLRequest("http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml")); myLoader.addEventListener(Event.COMPLETE, processXML); function processXML(e:Event):void { myXML = new XML(e.target.data); trace(myXML.*); } With this I get the whole xml

Network Game by Adobe Air programming in Adobe Flash

自作多情 提交于 2019-12-25 09:00:42
问题 I want to create a simple game (Adobe Air) based on 2 players using ActionScript 3. Let's assume I want to create online chess game. So that I can play with my friend at work, at home, from anywhere via internet. Should I use flash server? Or something similar for this purpose, or there is simpler way to connect 2 players and make fully functional interaction between them? I need to know, where to start. Any online tutorials, sample codes will really help me. Thank you! 回答1: You can use Flash

Error 1010 in ActionScript

冷暖自知 提交于 2019-12-25 08:59:04
问题 After compiling and running my program, i run into runtime error 1010: TypeError: Error #1010: A term is undefined and has no properties. at DC/updateScore()[DC::frame74:36] This is the piece of code: function updateScore(e:MouseEvent) { var i:uint=0; for(;i<balls.length;i++) if(balls[i]==e.target) break; if(balls[i].isCorrect) { score++; timeField.text = new String(score); } else { score--; timeField.text = new String(score); } } What's the problem? I'm using updateScore function for

as3 hittestobject not working, dont understand why

 ̄綄美尐妖づ 提交于 2019-12-25 08:56:49
问题 the collision not working i cant understand why, i put collision movieclips in the object and it doesnt seem to recognise one of the but does with the other, sorry for the confusing way of stating the problem if you play the game you will understand. im open to changing the way collision works too as long as it works ill be super happy 回答1: I'll try to explain. When You click "Down" or "Up" hero (box_MC) collide with both doors "Top_Door" and "Bottom_Door". Inside "bang" function at first

is it possible to pin AIR app over any opened windows?

旧城冷巷雨未停 提交于 2019-12-25 08:53:48
问题 I need to pin AIR application over other windows, I mean, regardless if AIR application is in focus or not, it must not hide, it always must be shown, whatever other program I activate or work with, AIR application must be over every window always. Is it possible? If it is, please show me the function (example code will be better :) ) which does it, incase if AS3 has one. 回答1: You're looking for the alwaysInFront property of the NativeWindow class: The alwaysInFront property specifies whether

Custom AS3 Class not Updating

这一生的挚爱 提交于 2019-12-25 08:26:22
问题 I've had a similar issue to this, but the means that I solved the last one are not working here. I have a custom class that consists of 12 separate .as modules. They're declared in the document class as follows: import trailcrest.v1.s3.averta; import trailcrest.v1.s3.chronos; import trailcrest.v1.s3.eripio; import trailcrest.v1.s3.fabrilla; import trailcrest.v1.s3.gradua; import trailcrest.v1.s3.lingua; import trailcrest.v1.s3.navigare; import trailcrest.v1.s3.pedem; import trailcrest.v1.s3

if clicked 1+2 button true or wrong.How I do that

久未见 提交于 2019-12-25 08:26:18
问题 A few fish come to the screen and stop after a while the other fishes come in.Then a while the stage is stopped and the player is trying to guess the first fishes.How can I create code to say that the chosen fish is wrong or true.For example:The first come 3 fishes it's correct and after then came fishes wrong.Player guess right all the fishes and earn coins or display win text bla bla.. I selected to sequence of the fish at timeline.So yes I animated.I was using as3 random function for the

Flex4: how to create the view states in as class (code-behind)

本小妞迷上赌 提交于 2019-12-25 08:25:13
问题 According to this document from Adobe Create and apply view states is <s:State/> a state object. How to create the view states in code-behind ActionScript class? 回答1: I have found a simple solution, and I don't have to declare the states using skinning architecture. I don't even to declare the states in my ApplicationClass which extends WindowedApplication. The solution is: declare the states only in the Main.MXML and by all means with the right namespace, in my case it should be "custom".

Adobe AIR 3.2 Glitch

我只是一个虾纸丫 提交于 2019-12-25 08:24:18
问题 I just finished a successful build of my program last night. Then, I get up this morning, and after an update fro Adobe AIR 3.1 to AIR 3.2, I find THIS bug! The same build under 3.1 works perfectly. However, as soon as 3.2 is installed, the following code after stopDrag fails silently. Mind you, it only fails in the packed and installed AIR application. It works perfectly when I test it inside of Adobe Flash Professional CS5.5 WHAT is going on? Here's the code I'm dealing with. Again, this

Need the example to use custom component in FLEX application

混江龙づ霸主 提交于 2019-12-25 08:18:21
问题 I want to know that how to create a CustomComponent and how to use that in FLEX Application. Give me just a simple example, i have little bit of knowledge is there so i can understand if u just give me the code. I am using FLEX 3.0 Thanks in advance. 回答1: Nice to see you again. Formatted Stepper.as package component { import flash.events.Event; import flash.events.FocusEvent; import flash.events.MouseEvent; import mx.controls.NumericStepper; import mx.core.mx_internal; import mx.events