actionscript-3

as3 Security Sandbox Violation

可紊 提交于 2019-12-23 04:35:05
问题 I've read all similar topics already with no luck, so I'm posting a new question about this error. I am trying to load a swf file from another swf file using this code: var loader:Loader = new Loader() //listen for loading progress loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgress); //listen for when the load is finished loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete); loader.contentLoaderInfo.addEventListener(SecurityErrorEvent.SECURITY_ERROR,

TextFormat doesn't do anything

社会主义新天地 提交于 2019-12-23 04:27:19
问题 my code is correct, but anyhow, anyway my textformat does not work, examine follow code. Didnt see what i did wrong. //SCROLLING SPEED var scrolling_speed:int = 2; //TEXT TO SCROLL var url:String = "tekst.txt"; var loadit:URLLoader = new URLLoader(); loadit.addEventListener(Event.COMPLETE, completeHandler); loadit.load(new URLRequest(url)); var my_text:TextField = new TextField(); addChild(my_text); function completeHandler(event:Event):void { my_text.text = event.target.data as String; } /

ActionScript 3 as a console app?

▼魔方 西西 提交于 2019-12-23 04:24:50
问题 Is it possible to have actionscript 3 as a console app? I want to play around with the language and do basic things like hello world and inheritances or file IO if thats allowed. Is there a REPL or a compiler (that will allow me to write a console app) for actionscript 3? 回答1: If you're serious about command line as3 you should have a look at redtamarin, based off the Mozilla Tamarin project: http://code.google.com/p/redtamarin/ Though I think the complexity of building the tools might defeat

How do I retrieve the node name from XML in Flex / Actionscript

耗尽温柔 提交于 2019-12-23 04:20:49
问题 I have some data xml data that looks like this <root xsi:noNamespaceSchemaLocation="test1.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <configuration> <CLICK/> <KLT/> <DETd/> </configuration> </root> I get a list of the configurations using var results:XMLList = xml.configuration.*; Now I want to loop over the XMLList and output CLICK, KLT, DETd etc. but how in XML do I get the node name as such 回答1: XML: <root> <parentNode> <childNode1>1</childNode1> <childNode2>2</childNode2>

upload image on twitpic using as3

孤街醉人 提交于 2019-12-23 03:41:30
问题 how I can upload image on twitpic using as3 and flash professorial cs6 and i try the code below and nothing happened Thank's in advance import flash.net.FileReference; import flash.filesystem.File; import flash.filesystem.FileMode; import flash.filesystem.FileStream; import flash.utils.ByteArray; var urlVars:URLVariables = new URLVariables(); urlVars.username = "xxxx"; urlVars.password = "xxxxx"; var urlRequest:URLRequest = new URLRequest("http://twitpic.com/api/upload"); urlRequest.method =

upload image on twitpic using as3

狂风中的少年 提交于 2019-12-23 03:41:19
问题 how I can upload image on twitpic using as3 and flash professorial cs6 and i try the code below and nothing happened Thank's in advance import flash.net.FileReference; import flash.filesystem.File; import flash.filesystem.FileMode; import flash.filesystem.FileStream; import flash.utils.ByteArray; var urlVars:URLVariables = new URLVariables(); urlVars.username = "xxxx"; urlVars.password = "xxxxx"; var urlRequest:URLRequest = new URLRequest("http://twitpic.com/api/upload"); urlRequest.method =

How do I set a certain color to be transparent?

懵懂的女人 提交于 2019-12-23 03:26:08
问题 I'm using copyPixels to copy a parts of a larger Bitmap to smaller Bitmaps to use for individual MovieClips. However, around there is still some extra space white space and corners around the Bitmaps' edges left over. How do I set the color white in the Bitmap to be transparent so I won't see these unsightly edges? 回答1: You can use the BitmapData.threshold method. This code creates a BitmapData with a red square on a blue background, then uses the threshold method to make the red pixels

URLLoader loads multi files and the result order is the same as call load()

守給你的承諾、 提交于 2019-12-23 03:21:42
问题 Since URLLoader is async, how to make sure the order of data from server side is the same as the loader.load() call? In other words, the data order in totalResults is the same order of url-related content? Following is code snippet: 1.for each(var url in urls) { loadData(url); } 2.private function loadData(url:String):void { var urlLoader:URLLoader = new URLLoader(); urlLoader.addEventListener(Event.COMPLETE, completeHandler); var request:URLRequest = new URLRequest(url); urlLoader.load

Get ActionScript Classes that Implement an Interface

谁说我不能喝 提交于 2019-12-23 03:12:27
问题 In ActionScript (AS3) how do I find all the classes that implement a particular interface? 回答1: In OOP terms, you never want to be able to do this: the primary characteristic of interfaces is they are terms of a contract. Any class can choose to fulfill that contract and be able to say "I implement this interface". Any code that references an instance of the interface don't care what class actually implements it: they don't have to; that's the really cool part of interfaces. But if you want

Is it possible to improve the performance of this drawing technique?

試著忘記壹切 提交于 2019-12-23 03:00:36
问题 Am currently working on a tool created by a colleague of mine and would like to improve performance. Basically, it's a tool for drawing on screen and uses a combination of Sprites and the Graphics class to draw a line segment every time the mouse is moved when the mouse button is down. Here is the drawing bit: // on MouseMove protected function drawLine(e:MouseEvent):void { if (currentTool.thickness > 0){ //pen var line:Sprite = new Sprite(); line.graphics.lineStyle(currentTool.thickness,