actionscript

Action Script 3. Change animations when character moving

痴心易碎 提交于 2019-12-11 23:36:48
问题 I'm creating simple flash game. I need to change animations when character moving. For example when going, running, jumping, attacking etc. I have different animations. Just I don't know how to add them correctly? In Library I have created my character, It named "Hero" As Linkage too "Hero". I need double click It and in Hero's timeline create new Layers with names run, walk, attack, etc... and then put here animations? Or I need in Library create name and As Linkage "HeroRun", "heroAttack"

Haars Cascade for Actionscript development

倾然丶 夕夏残阳落幕 提交于 2019-12-11 23:32:25
问题 I have an object that I want to be able to recognize in AS3. There's a port of OpenCV for AS3 already, that works with Haars cascades, so now I need to create a cascade of my object. From what I've read, I'll have to create an XML of several images (positive and negative), but I can't find a program that'll do that for Mac OS X. Is there anything I can use that'll generate that XML on Mac OS X? Cheers, Andre 回答1: It's just a parsing job. Use this: http://www.moment77.se/flash-classes/code

Call JavaScript function within ActionScript

家住魔仙堡 提交于 2019-12-11 20:42:13
问题 I'm not familiar with ActionScript and for some reason the following code won't work, although it was mentioned that way in a tutorial: class Dummy { function Dummy() { } static function main(mc) { getURL("javascript:alert('works!')"); } } I used "mtasc" to compile the script. 回答1: when you're embedding the flash file in your page are you setting allowscriptaccess="true" so like: <embed src="flash.swf" allowscriptaccess="true"></embed> 回答2: Did you specify a document class for your flash file

esc from fullscreen using video in full screen minimizes whole app in flex

本小妞迷上赌 提交于 2019-12-11 20:30:08
问题 I have an application intended to run in full screen mode. In order to prevent it from getting out of full screen I did: protected function windowedapplication_preinitializeHandler(event:FlexEvent):void { nativeWindow.stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown); nativeWindow.stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE; } protected function onKeyDown(event:KeyboardEvent):void { if (event.keyCode == 27) { event.preventDefault(); } } That prevents the app getting

Flex force socket to flush

和自甴很熟 提交于 2019-12-11 19:32:08
问题 How can I force the socket to be flushed before next data to be send? Example code: public function socketSend(data:String):void { socket.writeUTFBytes(data); socket.flush(); } This works basically fine. But sometimes, it doesn't flush the socket, but combine current information with next information and send together. This is what I don't want because it breaks my application communication. For example, if I call socketSend('command1') and then call socketSend('command2') I am hoping it will

Action Script 3. Animation loop forever after gotoAndStop() and have lag during animation when character have collisions

不羁岁月 提交于 2019-12-11 19:26:37
问题 I'm creating simple flash game. I have problem, animation loop forever after I user gotoAndStop() and I have lag when during animation if character have collision with ground or any stage (if character flying on the air don't have any lags) Here is collision list: var myCollisionList:CollisionList = new CollisionList(Hero); myCollisionList.addItem(ground); myCollisionList.addItem(ground3); myCollisionList.addItem(ground5); myCollisionList.addItem(ground4); And here is my part of code where

Flex id contentGroup query

帅比萌擦擦* 提交于 2019-12-11 19:22:26
问题 iam learning Flex and practising skins. So, i just had one doubt: I have written one custom skin named : ApplicationContainerSkin.mxml <?xml version="1.0" encoding="utf-8"?> <s:SparkSkin xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx"> <s:states> <s:State name="normal" /> <s:State name="disabled" /> </s:states> <fx:Metadata> [HostComponent("spark.components.Application")] </fx:Metadata> <fx:Declarations> <!-- Place

Create actionscript Application file for Flex project

删除回忆录丶 提交于 2019-12-11 19:18:52
问题 I'm trying to create Flex project with an actionscript application file, not a mxml file. I simply use this code : package { import spark.components.Application; public class Test extends Application { public function Test(){ super(); } } } But I receive this error : TypeError: Error #1007: Instantiation attempted on a non-constructor. at mx.preloaders::Preloader/initialize()[E:\dev\4.y\frameworks\projects\framework\src\mx\preloaders\Preloader.as:261] at mx.managers::SystemManager/http://www

Action Script. Remove all objects with Try Again button

 ̄綄美尐妖づ 提交于 2019-12-11 18:59:46
问题 I'm creating Flash "memory" game, Idea to discover 2 equal cards. And I need to make "Try again" button, which remove all cards and spawn new. Here is main game function: public function MemoryGame() { tryAgain.addEventListener(MouseEvent.CLICK, darKarta); timer = new Timer(1000); //create a new timer that ticks every second. timer.addEventListener(TimerEvent.TIMER, tick, false, 0, true); //listen for the timer tick txtTime = new TextField(); addChild(txtTime); tmpTime = timer.currentCount;

include .as file inside .fla

你说的曾经没有我的故事 提交于 2019-12-11 18:44:08
问题 i open up .fla file, but when i click window->action, there is not actionscript inside it. may i know where else can i check the .fla file is importing .as file. where to check it in flash cs3? 回答1: Opening the Actions window only shows you script attached to the frame you've currently selected. Try opening Window -> Movie Explorer. This lets you browse all the contents (including scripts) contained in the movie (make sure the "show: ActionScript" button is selected). Then look through any