actionscript-3

as3 accessing Children from dynamicly added moiveclip

拜拜、爱过 提交于 2019-12-25 04:09:28
问题 I am adding moiveClips and putting their position accordingly. I am placing all the dynamically added clips in one new movie clip and then centering that on stage. As a test, I see I can control the alpha in the main container but I can not access the children. How can I assess each flagButton separately? There would be several in this loop example below. var flagButton:MovieClip; var flagArray:Array = new Array; var flagDisplayButtons:MovieClip = new MovieClip(); function displayFlagButtons(

In ActionScript 3.0, can you use addEventListener for one class to react to the function call of another class?

南笙酒味 提交于 2019-12-25 04:07:49
问题 I know how to use addEventListener for one class to react to another class's button being clicked on. What if you want to use it for a more general purpose than that? What if you want to use it to react to one of the member functions of the other class being called? Is there a syntax for that? Thanks! Edit: Please note that I have already Googled for the answer. 回答1: You can create your own events and dispatch them from the other class and listen to them in your listening class. Here is some

When using the 'Class' datatype, how can I specify the type so I only accept subclass of a specific class?

孤人 提交于 2019-12-25 04:06:24
问题 I've got a method that accepts a parameter of type Class , and I want to only accept classes that extend SuperClass . Right now, all I can figure out to do is this, which does a run-time check on an instance: public function careless(SomeClass:Class):void { var instance:SomeClass = new SomeClass(); if (instance as SuperClass) { // great, i guess } else { // damn, wish i'd have known this at compile time } } Is there any way to do something like this, so I can be assured that a Class instance

When using the 'Class' datatype, how can I specify the type so I only accept subclass of a specific class?

烂漫一生 提交于 2019-12-25 04:06:18
问题 I've got a method that accepts a parameter of type Class , and I want to only accept classes that extend SuperClass . Right now, all I can figure out to do is this, which does a run-time check on an instance: public function careless(SomeClass:Class):void { var instance:SomeClass = new SomeClass(); if (instance as SuperClass) { // great, i guess } else { // damn, wish i'd have known this at compile time } } Is there any way to do something like this, so I can be assured that a Class instance

dynamically create multiple TextFields based on array.length

。_饼干妹妹 提交于 2019-12-25 04:02:40
问题 I've been looking around all day and havent had any luck finding a solution for this. What im looking to do is dynamically create TextFields based on my array.length. So if I have 3 strings in my array then 3 TextFields with the array text needs to be created. I've managed to actually create TextFields based on the array.length - however afterwards I dont know how to reference them individually, to lets say re-position x, y for array[1]. I've tried saving the Textfields in another array by

dynamically create multiple TextFields based on array.length

百般思念 提交于 2019-12-25 04:01:35
问题 I've been looking around all day and havent had any luck finding a solution for this. What im looking to do is dynamically create TextFields based on my array.length. So if I have 3 strings in my array then 3 TextFields with the array text needs to be created. I've managed to actually create TextFields based on the array.length - however afterwards I dont know how to reference them individually, to lets say re-position x, y for array[1]. I've tried saving the Textfields in another array by

Saving and masking webcam still AS3 AIR IOS

萝らか妹 提交于 2019-12-25 04:01:13
问题 I am aiming to create an application where the user can take a picture of their face, which includes an overlay of a face cutout. I need the user to be able to click the screen and for the application to save the picture, mask it with the same face cutout, and then save it to the applications storage. This is the first time using AIR on IOS with Actionscript3. I know there is a proper directory that you are supposed to save to on IOS however I am not aware of it. I have been saving other

AS3 - Countdown timer color change

亡梦爱人 提交于 2019-12-25 03:55:11
问题 With the help of an online tutorial, I created a simple 60 second countdown timer. I'd really like the text color to change to red once the timer hits 10 seconds. Any clue how I can add to this AS to make that happen? Bonus question: when the timer hits zero, I'd love for the entire text field to fade out so that the zero isn't visible anymore. Any thoughts on that? Here's my code, and thank you!!! var nCount:Number = 60; var myTimer:Timer = new Timer(1000, nCount); timer_txt.text = nCount

Get composed MovieClip's containing (parent) class after event

僤鯓⒐⒋嵵緔 提交于 2019-12-25 03:45:11
问题 I have a MovieClip that is composed in a parent (non-display object) class. We register an event listener against that movieclip - a CLICK handler for example. With event.target I can get a reference to the MovieClip from within the event handler. But how can I pull a reference to its composing class? I could simply add a "parentClass" property on the dynamic MovieClip class, but I'm wondering if there's a more elegant/idiomatic way of doing it that I should consider? 回答1: If the class that

Is there a way to check the value of the loop parameter from ActionScript?

a 夏天 提交于 2019-12-25 03:44:34
问题 There are a number of parameters that can be added to object and embed tags to embed flash videos. Most are listed here. Some of them can be accessed/changed programmatically via ActionScript (e.g. <param name="scale"> can be accessed via stage.scaleMode ). Can the value for the loop parameter be accessed/changed? Edit to add: I know about flashvars, that's not what I'm asking. 回答1: The general net consensus is that no, you can not access parameters other than flashvars/movie from inside