actionscript-3

communication between as2 and as3

孤人 提交于 2019-12-13 15:22:32
问题 I have this code under a button in 'as2.swf' on (release) { unloadMovie(this); } and this swf is being loaded into as3 container called 'main.swf', but when i press it nothing happens and the file does not unload itself. any one can enlighten me on that? 回答1: ActionScript 3 uses the AVM2 virtual machine while ActionScript 2 uses the older AVM. This means that they are not in the same sandbox. Thus communication between the two is difficult at best. AVM2(as3) can load and work with AVM1(as2)

Draw line from object to Mouse (AS3)

心不动则不痛 提交于 2019-12-13 15:21:46
问题 My code is here: graphics.clear(); graphics.lineStyle(1, 0, 1); graphics.moveTo(cannon.x, cannon.y); graphics.lineTo(mouseX, mouseY); It doesn't seem to be drawing anything. BTW it's in ENTER_FRAME right now. 回答1: refer a following code. this is my simple code draw app. And paste the code below: startX and startY should instead changes to the your object( cannon ). If you want remove prior line. call a this.graphics.clear(); at onDrawReady Handler. var isDrawingReady:Boolean; var startX

What's the reason for interface to exist in Actionscript-3 and other languages

怎甘沉沦 提交于 2019-12-13 15:17:30
问题 what is the meaning of this interfaces? even if we implement an interface on a class, we have to declare it's functionality again and again each time we implement it on a different class, so what is the reason of interfaces exist on as3 or any other languages which has interface. Thank you 回答1: I basically agree with the answers posted so far, just had a bit to add. First to answer the easy part, yes other languages have interfaces. Java comes to mind immediately but I'm pretty sure all OOP

pass < or > operator into function as parameter?

拈花ヽ惹草 提交于 2019-12-13 14:30:30
问题 Inside my function there is an if() statement like this: if(passedValue < staticValue) But I need to be able to pass a parameter dictating whether the if expression is like above or is: if(passedValue > staticValue) But I cant really pass < or > operator in has a parameter, so I was wondering what is the best way to do this? Also if the language I am using matters its ActionScript 3.0 Thanks!! 回答1: Instead of passing an operator, which is impossible in AS3, why not pass a custom comparison

Flash Printing - Chrome Omits Sprites When Printing

醉酒当歌 提交于 2019-12-13 14:07:53
问题 Quick Summary We have a Flash application (AS3) that gives users the ability to read, interact and print content embedded within it. We've recently noticed that when printing from Chrome, content is omitted and empty pages are printed (note, blank pages appear in Chrome's print preview as well). We're seeing this issue with Chrome's version "21.0.1180.83" (using Flash Version " 11.3.31.230 "). This is not reproducible in any other browser. Technical Details Each page of content is represented

ApplicationDomain clarifiation needed

若如初见. 提交于 2019-12-13 14:06:23
问题 I need some clarification on this subject as I just ran into an issue with loading swfs into a reused loader object. So lets say I have 3 SWFs. Main.swf childA.swf childB.swf Main.swf has a loader object in it that gets reused (myloader.load("childA.swf")) and childA or childB swf will be loaded via user interaction. Both child swfs have a com package with a class in that package called config. The config files are different files for both classes just named the same. both child swf also

visible property of DisplayObject

蓝咒 提交于 2019-12-13 13:28:55
问题 For example I have a hierarchy of movie clips. mc1 is a child of mc, and mc2 is a child of mc1. Turns out that when I set mc1.visible = false; mc2.visible stays true. Is that supposed to happen? Is there a shortcut for testing visibility of mc2? Code to play with: var mc = new Sprite(); mc.graphics.beginFill(0xFF0000); mc.graphics.moveTo(50,50); mc.graphics.lineTo(100,50); mc.graphics.lineTo(100,100); mc.graphics.lineTo(50,100); mc.graphics.endFill(); var mc1 = new Sprite(); mc1.graphics

What is the relationship between Flex, Flash and ActionScript 3.0

孤人 提交于 2019-12-13 11:53:59
问题 I'm working on a project that uses ActionScript 3.0 with Flex SDKs. The project is built using the Eclipse IDE. I wonder if the Flex SDKs are used to support ActionScript 3.0 in Eclipse? What is the relationship between ActionScript 3.0 and Flash? 回答1: Its a good question, and one of which many people tend to be confused with. - Flash The all singing, all dancing graphics and vector stuff you'll be aware of - This is primarily deemed as the visual stuff. When you open Adobe Flash, its an

Can we change stage size dynamically?

隐身守侯 提交于 2019-12-13 10:53:24
问题 Am working on flash cs6 and AIR 14.I developed one app i want to adjust that app to all android and ios devices.for that i want to change my stage size dynamically according to screen resolution of device.Is it possible to do that.if yes how ? 回答1: Yes, It is possible. First thing you need to do is the following: (as soon as your application has access to the stage) stage.scaleMode = StageScaleMode.NO_SCALE; stage.align = StageAlign.TOP_LEFT; This will make your stage not scale and become the

Flex - Search/Filter DataGrid by Text Input

允我心安 提交于 2019-12-13 10:25:52
问题 I’m using a filter setup that I found online and I’m having trouble filtering my mx:DataGrid using three components – comboBox, checkbox and text input. The checkbox and comboBox are working properly with my IFilter interface and Filter class, but I’m unable to get the search input working correctly. Here’s of the code from the source files package com.daveoncode.filters { //Defines a common interface that must be implemented by all the filters. public interface IFilter { function apply(item