actionscript-3

trying to remove MovieClip from stage

妖精的绣舞 提交于 2020-01-16 00:38:10
问题 I am getting a little fustrated with trying to remove a MovieClip from my stage after I am done with it. On loading my frame, I have a little bit of code in a function that creates a piechart. var piechart:MovieClip = new MovieClip(); stage.addChild(piechart); //Then a bunch more to draw the pie chart So that bit of code is NOT on my "Actions" layer. Now I have a button on this frame that navigates to a different frame in the timeline but when I change frames, the piechart remaines. So, how

Order of items in objects in ActionScript

纵然是瞬间 提交于 2020-01-16 00:35:28
问题 Try to compile: var object:Object = {}; object.one = "foo"; object.two = "foo"; object.three = "foo"; object.four = "foo"; for(var key:String in object) { trace(key); } ... you will get: one four two three Why the messed up order? 回答1: The keys of an object are not ordered. If you need to preserve order and have a lookup, then you need to create a custom collection that provides that functionality. 回答2: Object in AS3 can be seen as a hashtable where the field name is the key. So you cant rely

How use swapDepths & getNextHighestDepth() in AS3?

强颜欢笑 提交于 2020-01-15 17:17:43
问题 I'm trying to convert the following code: DNA0.swapDepths(this.getNextHighestDepth()) I tried it this way: DNA0.swapChildren(stage.getChildIndex(DNA0)); But its not working... I guess I didn't understand the logic. Anybody help me? ----EDIT---- @gladoscc, good job. it's work. But I have other convert problems.. Like, this['DNA'+DNAsy.length].y = this['DNA'+(DNAsy.length-1)].y; this['DNA'+DNAsx.length].x = this['DNA'+(DNAsy.length-1)].x; DNAsy.push(this['DNA'+DNAsy.length].y) DNAsx.push(this[

How can I load a Fusion Tables csv from a client application?

和自甴很熟 提交于 2020-01-15 12:37:08
问题 I was just playing with Google Fusion Tables and I was wondering how I could load a csv from the client side. So far I've tried several options: From actionscript 3.0: var r:URLRequest = new URLRequest("https://www.google.com/fusiontables/exporttable?query=select%20*%20from%203685185%20"); r.method = URLRequestMethod.GET; var l:URLLoader = new URLLoader(r); l.addEventListener(Event.COMPLETE,loaded); l.addEventListener(HTTPStatusEvent.HTTP_STATUS,onHTTPStatus); function onHTTPStatus(event

Setting X Coordinate from Mouse Location

吃可爱长大的小学妹 提交于 2020-01-15 12:20:38
问题 i have a darkBlueRect rectangle sprite and a copy of the same sprite with a larger scale and a lighter color - lightBlueRect . i'm attempting to shift the location of the lightBlueRect according to the mouse.x location when the mouse is moving over the darkBlueRect . this way if the mouse is on the right of the darkBlueRect than the location of the scaled up lightBlueRect will be on the opposite side and shifted towards the left proportionate to the mouse position and scale. in addition, the

How do I load a YouTube video in Flash Builder?

百般思念 提交于 2020-01-15 12:15:05
问题 I'm trying to play a Youtube video in Flash Builder. Each time I play the file I get an error message: SecurityError: Error #2121: Security sandbox violation: Loader.content: https://www.youtube.com/v/FGtTEmBR7Sk cannot access https://s.ytimg.com/yts/swfbin/player-vflQiDuyQ/watch_as3.swf. This may be worked around by calling Security.allowDomain. at flash.display::Loader/get content() at com.google.youtube.application::SwfProxy/onRequestParameters() at flash.events::EventDispatcher

How do I load a YouTube video in Flash Builder?

放肆的年华 提交于 2020-01-15 12:06:54
问题 I'm trying to play a Youtube video in Flash Builder. Each time I play the file I get an error message: SecurityError: Error #2121: Security sandbox violation: Loader.content: https://www.youtube.com/v/FGtTEmBR7Sk cannot access https://s.ytimg.com/yts/swfbin/player-vflQiDuyQ/watch_as3.swf. This may be worked around by calling Security.allowDomain. at flash.display::Loader/get content() at com.google.youtube.application::SwfProxy/onRequestParameters() at flash.events::EventDispatcher

Dynamically changing the referenced XML file in Flash AS3?

拈花ヽ惹草 提交于 2020-01-15 11:58:26
问题 Basically I have media being parsed and played by reference of an XML document using AS3. These media files are gonna be seperated into seperate XML files then what I was planning was to just dynamically change which XML file is being referenced. Problem is, the code only fires once on frame 2 and I can't seem to figure out how to switch out the XML file for a different one upon an event trigger. "new URLRequest(www.blah.com/theotherXMLfile.xml)" isn't working...do I need to reload a whole

Flex: Is there anyway to disable the textfield in the NumericStepper and force the user to change the value only by using the up/down buttons?

安稳与你 提交于 2020-01-15 11:46:05
问题 Probably not much more to elaborate on here - I'm using a NumericStepper control and I want the user to use the buttons only to change the value in the NS, not by typing into the control - I couldn't find a property to disable the text - does it exist? If it doesn't, how would I subclass this thing to disable the text? 回答1: In general, if you're using mx_internal, there's a decent chance that your app will break between flex versions. 回答2: Ok - I think I got it - there is no property you can

Is there an way to load external swf into a sandbox in flash?

筅森魡賤 提交于 2020-01-15 11:26:08
问题 I'm loading flash ad-banners inside my all flash site with Loader. I have no control over the code inside the banners as they come from advertisers. I'd like to load them so that there is no way they can mess up the mouse events on the site outside their limited area. Sloppy code on advertisers banner should not kill my site's functionality in any situation. Bonus question, how can I solve the problems caused by the banners being a different frame rate than my main site? (Or is there an easy