actionscript-3

Actionscript 3 - How to keep the value from an event after removing that event

南楼画角 提交于 2021-02-19 08:14:06
问题 I set a value to my xml object (xml = new XML(e.currentTarget.data);) during my event handler function (the function is executed after the event.COMPLETE) and if I trace the object inside my event function handler it shows my xml data. but if I try to trace it outside the event handler function it doesn't show my xml content. Isn't there a way to get my xml object content value to show in an other function but not in the event handler function? private var xml:XML; public function XMLLoader

Async operation in Actionscript

删除回忆录丶 提交于 2021-02-11 16:40:19
问题 I've read some things about async waits in Actionscript but can't really do it in practice. Here's a short, simplified version of my code I have in a class: private function getXML():void { var xmlLoader:URLLoader = new URLLoader(); xmlLoader.addEventListener(Event.COMPLETE, loadXML); xmlLoader.load(new URLRequest("test.xml")); } private function loadXML(evt:Event):void { var xmlData:XML = new XML(evt.target.data); this.parseResults(xmlData); } private function parseResults(resultsInput:XML)

OnEdit need to send emails from a column

送分小仙女□ 提交于 2021-02-11 15:58:08
问题 When in column O cell is mentioned "Shipped" I want to send emails in column C (with corresponding row) Need support to get this script right function sendEmail(e) { var thisSheet = e.source.getActiveSheet(); if (thisSheet.getName() !== 'CRM' || e.range.columnStart !== 15 || e.range.rowStart == 1 || e.value !== 'Shipped') return; var body, headers = thisSheet.getRange(1, 1, 1, 6) .getValues()[0], thisRow = thisSheet.getRange(e.range.rowStart, 1, 1, 6) .getValues()[0], recipientsEMail =

Using Actionscript Worker to loop function to make it faster

爱⌒轻易说出口 提交于 2021-02-11 12:23:54
问题 My current code that allow application to upload data inside of Excel file into the AIR app is as follows; import lib.xlsxreader.Worksheet; import lib.xlsxreader.XLSXLoader; public class Main extends MovieClip { private var fileGet: File = new File(); private var xloader: XLSXLoader = new XLSXLoader(); public function Main() { fileGet = File.applicationDirectory; fileGet.addEventListener(Event.SELECT, selectExcel) xloader.addEventListener(Event.COMPLETE, uploadComplete); button

1046: Type was not found or was not a compile-time constant: ServerSocketConnectEvent

倖福魔咒の 提交于 2021-02-10 23:25:16
问题 I am trying to get the adobe AIR SocketServer class to work. When I pasted in this code from the adobe website: import flash.net.ServerSocket; import flash.events.ServerSocketConnectEvent; function onConnect(e:ServerSocketConnectEvent):void { var incomingSocket:Socket = e.socket; } var server:ServerSocket = new ServerSocket(); server.addEventListener(Event.CONNECT, onConnect); server.bind(8888); I got the error saying that the SocketServerConnectEvent could not be found. However, there is an

1046: Type was not found or was not a compile-time constant: ServerSocketConnectEvent

妖精的绣舞 提交于 2021-02-10 23:19:41
问题 I am trying to get the adobe AIR SocketServer class to work. When I pasted in this code from the adobe website: import flash.net.ServerSocket; import flash.events.ServerSocketConnectEvent; function onConnect(e:ServerSocketConnectEvent):void { var incomingSocket:Socket = e.socket; } var server:ServerSocket = new ServerSocket(); server.addEventListener(Event.CONNECT, onConnect); server.bind(8888); I got the error saying that the SocketServerConnectEvent could not be found. However, there is an

AS3: How do I get dynamic loader URL from LoaderInfo in Event Listener Function?

一曲冷凌霜 提交于 2021-02-08 12:43:19
问题 I'm loading many pictures, and am using an array to do so. loader[i].load(new URLRequest(picture[i])); My Event Listener function is enabled like this: loader[i].contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete); My onComplete event handler shows this: trace(e.target); //OUTPUT: [object LoaderInfo] I've looked for properties in LoaderInfo that might identify which loader initiated the listener (the value of "i") so that I can putz around with each one specifically, like this:

Properly link SWF library when compiling Actionscript 3 Air poject using as3mxml

本小妞迷上赌 提交于 2021-01-29 10:06:59
问题 In my attempts to achieve the following: compile library.swf that contains different common scripts; compile different SWFs that link library.swf and use these common scripts without copying code to own resulting SWFs; I was trying to use acompc and mxmlc , however I couldn't achieve the approach above. Recently I came up across as3mxml plugin for Visual Studio Code (VSC) which I gave a try as at least it had some examples. Here is my MVP: Project library that builds library.swf , library.swc

Operate multiple arrays simultaneously

可紊 提交于 2021-01-29 09:05:15
问题 I am using as3 in adobe animate to create a video game. I have created multiple arrays with movie clips e.g. var A:Array [mc1, mc2, mc3] var B:Array [mc4, mc5, mc6] var C:Array [mc7, mc8, mc9] var anObject:DisplayObject; How can I operate all movie clips in all arrays simultaneously? I have tried this: mc_Player.addEventListener(MouseEvent.CLICK, Change_Position); function Change_Position (event:MouseEvent):void { {for each (anObject in A) & (anObject in B) & (anObject in C) // how can I get

addEventListener with ruturn in AS3 - How?

时光毁灭记忆、已成空白 提交于 2021-01-29 08:26:54
问题 I'm a new Flash AS3 job but I have a big problem using some OOP concepts like return from methods, when I needs a Event Listener code. The problem is that the function from Event Listener cannot return a value. How can I work with this issue? This is a code sample that I using on my AIR app. This code I want to re-use in other situations that I want to parse a directory files. private function initApp():void { try { // Seta o diretoório de molduras var directory = diretorio_mestre.resolvePath