actionscript

Unloading swf using the unloadAndStop() method, but video sounds remain audible

天涯浪子 提交于 2019-12-02 07:19:37
I have tried many approaches to unloading my swf, but to no avail, the video sounds within my laoded swf keep playing even once the swf has been loaded. I have created a universal loader as follows: var loader:Loader = new Loader(); I then load various swf's into a movie clip named mov_contentLoader , for example the video swf is loaded as follows: loader.load(new URLRequest("video.swf")); //assign SWF url to loader mov_contentLoader.addChild(loader); //add loaded content to movi clip I then have a generic "exit" button, based on the state of the application, certain windows are closed, swf's

Embed bitmap in ActionScript3

风流意气都作罢 提交于 2019-12-02 06:05:03
问题 How can I embed a bitmap in Actionscript 3 and get the BitmapData? public class MyGame extends Sprite { [EMBED(source="Assets/helicopter1.png")] private static var BMClass:Class; public function MyGame() { var BM:Bitmap = new BMClass(); var BMData:BitmapData = new BitmapData(BM.width, BM.height); BMData.draw(BM) } } I've tried everything. If I ever try to instantiate the embedded class ( new BMClass(); ) I get this error: TypeError: Error #1007: Instantiation attempted on a non-constructor. .

flex和javascript之间的交互

删除回忆录丶 提交于 2019-12-02 05:47:25
flex中可以监听浏览器窗口的大小变化,但有些时候浏览器大小的变化flex不能直接监听到,因为该窗口不是顶层窗口,所以就需要在javascript中获得浏览器的大小,然后通过js通知给as3,再在flex界面中做相应的改变。 使用javascript来获得浏览器窗口的大小是要修改flex工程中的html-template文件夹下面的index.template.html文件。 需要添加如下代码来实现获得浏览器窗口大小: <!-- scwidth or scheight --> var winWidth = 0; var winHeight = 0; function findDimensions() { //获取窗口宽度 if (window.innerWidth) { winWidth = window.innerWidth; } else if ((document.body) && (document.body.clientWidth)) { winWidth = document.body.clientWidth; //获取窗口高度 } if (window.innerHeight) { winHeight = window.innerHeight; } else if ((document.body) && (document.body.clientHeight)){

What is faster plain objects or strongly typed objects in actionscript?

核能气质少年 提交于 2019-12-02 05:18:51
问题 So is public var user:Object = {}; user["firstName"] = "Bill"; user["lastName"] = "Cosby"; slower than if I have a value object like User? var user:User = new User(); user.firstName = "Bill"; user.lastName = "Cosby"; 回答1: public function speedTest():void { var typedObjects:Array = []; var dynamicObjects:Array = []; var typedObject:User; var dynamicObject:Object; var i:int = 0; var n:int = 10000; for (i; i < n; i++) { dynamicObject = {}; dynamicObjects.push(dynamicObject); typedObject = new

currentFrame of root timeline from inside object

*爱你&永不变心* 提交于 2019-12-02 03:05:32
问题 Is it possible to pull the currentFrame of the root timeline from inside an object class? Normally a currentFrame call only checks the frame of the movieclip it's attached to within an object class, so how would you go about checking the frame of the entire project from within the object class file? edit: Nevermind, I found what I was looking for. All you have to do is use MovieClip(root).currentFrame and it works just fine. Consider the question answered. 回答1: Nevermind, I found what I was

Flash to take the view to fullscreen

前提是你 提交于 2019-12-02 02:56:24
I need a link to invoke a flash movie (with javascript) that takes the view to full screen, and show the page content. Exactly as if the user has pressed F11. Is there such flash movie? Edit This is different from what the flash player does on Youtube and other video sites in that the flash movie has no content to show and after the page goes fullscreen I want the normal page content to be displayed. The only role of the flash object would be invoking the fullscreen mode. Diodeus - James MacFarlane JavaScript (and therefore Flash) does not have access to activating full-screen mode (and thank

Actionscript 2 large tile-based maps creating lag

家住魔仙堡 提交于 2019-12-02 02:53:45
问题 I'm wondering what the best way to go about creating large, tile-based maps in flash with actionscript 2 would be. With my current code, any maps over 35x35 (1225 movieclips) start to lag. The maps are created from a simple multi-demensional array, eg. var map = [[95,23,25,23,16,25],[95,23,25,23,16,25],[95,23,25,23,16,25]]; The program simply creates a movieclip of a tile, goes to the appropriate frame and places the tile relative to the player's location. Each tile has one property, that is

How can i on button press execute a command in the command prompt and get back the output in ActionScript?

天大地大妈咪最大 提交于 2019-12-02 02:13:42
问题 I have a GUI using Flex. I have a condition like i need to execute some command line arguments in the local machine and get the results back or output back to a textbox area. How can i do a button on submit, execute command in the local machine and return the output? Command to execute example: echo logfile.log | grep username Code: button1.onRelease = function () { // in this computer, it will now run a command, please wait. } My reference from the answer: https://gist.github.com/993905 回答1:

Embed bitmap in ActionScript3

一个人想着一个人 提交于 2019-12-02 02:12:57
How can I embed a bitmap in Actionscript 3 and get the BitmapData? public class MyGame extends Sprite { [EMBED(source="Assets/helicopter1.png")] private static var BMClass:Class; public function MyGame() { var BM:Bitmap = new BMClass(); var BMData:BitmapData = new BitmapData(BM.width, BM.height); BMData.draw(BM) } } I've tried everything. If I ever try to instantiate the embedded class ( new BMClass(); ) I get this error: TypeError: Error #1007: Instantiation attempted on a non-constructor. . If I use [EMBED(source="Assets/helicopter1.png")] private static var BMClass:BitmapData; or something

handling ctrl + key event in IE browser

有些话、适合烂在心里 提交于 2019-12-02 02:10:15
I'm using hotkeys ( Ctrl + key ) in my flex application. getting problem when my app is running in IE. when I press Ctrl + D , im getting 'Add a Favorite' window of IE. How should I override the default behaviour of the browser? if possible, give me some example. Robusto In your event handler, try event.returnValue = false; See this SO thread: event.preventDefault() function not working in IE 来源: https://stackoverflow.com/questions/2364004/handling-ctrl-key-event-in-ie-browser