Search Results

Search found 2242 results on 90 pages for 'actionscript 3'.

Page 23/90 | < Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >

  • Actionscript 3: Monitoring the activity level for multiple Microphones doesn't seem to work.

    - by Dave
    For a project I want to show all available webcams and microphones, so that the user can easily select whichever webcam/microphone combination they prefer. I run into an issue with the microphones listing though. Each microphone is listed with an activity animation and it's name. I am able to list all Microphones just fine (using the Microphone.names Array), but it seems like I can only get the activity viewer to work for one microphone. The other microphones show up with '-1' activity, which (as far as I know) is Flex for 'present, but not in use'. When unplugging the microphone that does show activity, the next one (in my case, the mic-in line on my motherboard) shows up with '0' activity (it's not connected, so that makes sense). During my testing I have a total of 3 microphones available, the not-connected onboard mic-in port, and two connected microphones. For testing purposes I use a timer that traces the current microphone activity each 100ms and the graph is also shown. It does not seem to matter what default microphone I set via flash' settings panel. The code I've only attached the revelant code snippets below to make it easier for you to read through them. Please let me know if you prefer the entire code. Main application.mxml Note: cont is a VBox. i is defined before this code snippet. var mics:Array = Microphone.names; for(i=0; i < mics.length; i++){ var mic:settingsMicEntry = new assets.settingsMicEntry; mic.d = {name: mics[i], index: i}; cont.addChild(mic); } assets/settingsMicEntry.mxml timer is defined before this code snippet. the SoundTransform is added to silence local microphone playback. Excluding this code does not solve the problem, sadly (I've tried). display is an MXML Canvas object. mic = Microphone.getMicrophone(d.index); if(mic){ // Temporary: The Microphones' visualizer var bar:Box = new Box(); bar.y = 50; bar.height = 0; bar.width = 66; bar.setStyle("backgroundColor", 0x003300); display.addChild(bar); var tf:SoundTransform = new SoundTransform(0); mic.setLoopBack(true); mic.soundTransform = tf; timer = new Timer(100); timer.addEventListener(TimerEvent.TIMER, function(e:TimerEvent):void{ var h:int = Math.floor((display.height/100)*mic.activityLevel); bar.height = (h>-1) ? h : 0; bar.y = (h>-1) ? display.height-h : display.height; trace('TIMER: '+h+' from '+d.name); }); timer.start(); } I'm pulling my hear out here, so any help is much appreciated! Thanks, -Dave Ps.: Pardon the messiness of the code!

    Read the article

  • Actionscript 3: How to remove all black pixels from BitmapData ?

    - by Adnan Doric
    Hello, Let say I have a BitmapData with different pixels representing an object, and some black pixels around it that I want to remove. I would like to obtain a new BitmapData, with width and height of the object represented by non-black pixels. For example, let say I have a BitmapData 400x400px, but the object represented by non-black pixels occupies the rect: x=100, y=100, width=200, height=200. I want to get new BitmapData representing that rect, all black pixels should be removed. Any idea on how to do this please ?

    Read the article

  • Actionscript not running in nested MovieClips in Swf loaded into AIR app.

    - by Stray
    I'm loading content swfs into an Air App. The swfs are loaded into the non-app sandbox, and any communication is via the parent/child sandbox bridge. The swfs have timeline code. This code executes fine. The swfs also have mcs on the timeline - any code inside these mcs, or any child mcs of these mcs, is ignored. Simple traces do not execute below the top level timeline of the loaded swfs. I have tried naming the child mcs. I have tried exporting them in the library. Neither makes any difference. When I run the swf standalone, I see my diagnostic traces. When I load the swf, I only see the traces for the top level timeline. Air app is v1.5 Any clues? I've been bashing into this brick wall for several hours now...

    Read the article

  • Changing the highlight color of text in Flash with ActionScript 2.

    - by Zachary Lewis
    I've got several input text fields, and my design requirement is to have gold text on a black background that, when highlighted, is black text on a gold background; however, Flash's default selected text highlight color scheme is white text on a black background and there is no way to change this. Does anyone have any workarounds that are easy to implement and don't require additional classes (the design requests minimal outside classes).

    Read the article

  • Actionscript Receiving Mouse Events For Lower Indexed And Partially Covered Display Objects?

    - by Chunk1978
    i have 2 sprites on stage. bottomSprite is added to the display list first, followed by topSprite. topSprite partially covers bottomSprite. i've added an event listener to bottomSprite for MouseEvent.MOUSE_MOVED notifications to simply trace the mouseX and mouseY coordinates. however, the notification doesn't work for the parts of bottomSprite that are covered by topSprite. var bottomSprite:Sprite = new Sprite(); bottomSprite.graphics.beginFill(0x666666, 0.5); bottomSprite.graphics.drawRect(150,150, 150, 150); bottomSprite.graphics.endFill(); addChild(bottomSprite); var topSprite:Sprite = new Sprite(); topSprite.graphics.beginFill(0x00FFFF, 0.5); topSprite.graphics.drawRect(250,50, 150, 150); topSprite.graphics.endFill(); addChild(topSprite); bottomSprite.addEventListener(MouseEvent.MOUSE_MOVE, traceCoords); function traceCoords(evt:MouseEvent):void { trace ("Coord = X:" + bottomSprite.mouseX + ", Y:" + bottomSprite.mouseY); }

    Read the article

  • what exactly does system.totalMemory test in Actionscript 3.0?

    - by vasion
    before somebody screaming RTFM, let me clarify. does system.totalMemory test the memory used in movie which invokes it, or used by all movies running on the browser/system? I want to initiate garbage collaction for my app when it reaches a certain limit and i dont want the process to be initialized by the user watching funny cats youtube video.

    Read the article

  • ActionScript / AIR - One Button Limit (Exclusive Touch) For Mobile Devices?

    - by TheDarkIn1978
    two years ago, when i was developing an application for the iPhone, i used the following built-in system method on all of my buttons: [button setExclusiveTouch:YES]; essentially, if you had many buttons on screen, this method insured that the application wouldn't be permitted do crazy things when several button events firing at the same time as any new button press would cancel all others. problematic: ButtonA and ButtonB are available. each button has a mouse up event which fire a specific animated (tweened) reorganization/layout of the UI. if both button's events are fired at the same time, their events will likely conflict, causing a strange new layout, perhaps a runtime error. solution: application buttons cancel any current pending mouse up events when said button enters mouse down. private function mouseDownEventHandler(evt:MouseEvent):void { //if other buttons are currently in a mouse down state ready to fire //a mouse up event, cancel them all here. } of course it's simple to manually handle this if there are only a few buttons on stage, but managing buttons becomes more and more complicated / bug-prone if there are several / many buttons available. is there a convenience method available in AIR specifically for this functionality?

    Read the article

  • Advanced text search in actionscript-return ALL nouns,adjectives and verbs..

    - by eco_bach
    Hi I know that as3 has some powerful new text search capabilities, especially when combined with regex. I don't even know if this is possible, but I would like to somehow, search any block of text, and return all nouns, adjectives and verbs. What would be the best(most efficent) way to do this? Is regex an option? or would I have to load in some sort of open sourced dictionary 9as used in spellcheckers) to compare with or?? After, I've pulled all the nouns, adjectives and verbs, I need to count and prioritize by their frequency. Any suggestions welcome...

    Read the article

  • New to MVC. Actionscript 3.0 Appreciate your help.

    - by Combustion007
    Hello Everyone, I am new to design patterns and am trying to learn the MVC implementation. I have written four classes: DataModel DataView DataController Main Main serves as the application facade. The main FLA is called HelloWorld. I have a symbol called "Box" in HelloWorld. I just would like to add an instance of the "Box" on the stage. Eventually I would like to place a button and when the button is clicked, the Box instance color will be changed. I would appreciate any help, please help me figure out what am I doing wrong. Here are my Classes: DATAMODEL CLASS: package { import flash.events.*; public class DataModel extends EventDispatcher { public static const UPDATE:String = "modelUpdate"; private var _color:Number = (Math.round(Math.random()* 0xffffff)); public function DataModel() { trace("DATA MODEL INIT"); } public function get color():Number { return _color; } public function set color(p:Number):void { _color = p; notifyObserver(); } public function notifyObserver():void { dispatchEvent(new Event(DataModel.UPDATE)); } } } //DATACONTROLLER CLASS: package { import flash.events.; import flash.display.; import flash.errors.*; public class DataController { private var _model:DataModel; public function DataController(m:DataModel) { trace("DATACONTROLLER INIT"); _model = m; } } } DATAVIEW CLASS: package { import flash.events.; import flash.display.; import flash.errors.*; public class DataView extends Sprite { private var _model:DataModel; private var _controller:DataController; private var b:Box; public function DataView(m:DataModel, c:DataController) { _model = m; _controller = c; b = new Box(); b.x = b.y = 100; addChild(b); } } } And Finally THE FACADE: package { import flash.display.; import flash.events.; import flash.text.; import flash.errors.; public class Main extends Sprite { private var _model:DataModel; private var _controller:DataController; private var _view:DataView; public function Main(m:DataModel, c:DataController, v:DataView) { _model = m; _controller = c; _view = v; addChild(v); } } } When I test the movie: I get this error: ArgumentError: Error #1063: Argument count mismatch on Main(). Expected 3, got 0. Thanks alot.

    Read the article

  • The standard map/associative-array structure to use in flash actionscript 3?

    - by tstyle
    I'm relatively new to flash, and is confused about what I should use to store and retrieve key value pairs. After some googling I've found various map-like things to choose from: 1) Use a Object: var map:Object = new Object(); map["key"] = "value"; The problem is that it seems to lack some very basic features. For example to even get the size of map I'd have to write a util method. 2) Use a Dictionary What does this standard library class provide over the simple object? It seems silly for it to exist if it's functionally identical to Object. 3) Go download some custom HashMap/HashTable implementation from the web. I've used a lot of modern languages, and this is the first time I haven't been able to find a library implementation of an associative array within 5 minutes. So I'd like to get some best-practice advice from an experienced flash developer. Thanks!

    Read the article

  • Why the actionscript 3.0 snippet below failed to import Button and TextInput?

    - by user198729
    package { import fl.controls.Button; import fl.controls.TextInput; public class MinRecord extends Sprite { private var recordBtn:Button; private var stopBtn:Button; private var textInput:TextInput; ... When I run it reports: Type was not found or was not a compile-time constant: Button. Type was not found or was not a compile-time constant: TextInput. Can someone point out what's wrong here?

    Read the article

  • ActionScript Local X And Y Coordinates Of Display Object?

    - by TheDarkIn1978
    i'm trying to trace the x and y coordinates from within a sprite. i've added a rectangle to the stage: var rect:Rectangle = new Rectangle(10, 10, 200, 200); addChild(rect); adding a Mouse_Move event to the rect, i can trace mouseX and mouseY to receive the coordinates of the stage while moving over the rect, but how do i get the local x and y coordinates? so if i mouse over the very top left of the rect sprite, the mouseX and mouseY return 10 as the global coordinates, but how do i make it return 0 and the local coordinates of the sprite? i assumed localX and localY was what i was looking for, but this doesn't work: function mouseOverTraceCoords(evt:MouseEvent):void { trace(mouseX, mouseY, evt.localX, evt.localY); }

    Read the article

  • What's the fastest way to search a very long list of words for a match in actionscript 3?

    - by Nuthman
    So I have a list of words (the entire English dictionary). For a word matching game, when a player moves a piece I need to check the entire dictionary to see if the the word that the player made exists in the dictionary. I need to do this as quickly as possible. simply iterating through the dictionary is way too slow. What is the quickest algorithm in AS3 to search a long list like this for a match, and what datatype should I use? (ie array, object, Dictionary etc)

    Read the article

  • Moving x,y position of all array objects every frame in actionscript 3?

    - by Dylan Gallardo
    I have my code setup so that I have an movieclip in my library a class called "block" being duplicated multiple times and added into an array like this: function makeblock(e:Event){ newblock=new block; newblock.x=10; newblock.y=10; addChild(newblock); myarray[counter] = newblock; //adds a newblock object into array counter += 1; } Then I have a loop with a currently primitive way of handling my problem: stage.addEventListener(Event.ENTER_FRAME, gameloop); function gameloop(evt:Event):void { if (moveright==true){ myarray[0].x += 5; myarray[1].x += 5; myarray[2].x += 5 -(and so on)- My question is how can I change x,y values every frame for new objects duplicated into the array, along with the previous ones that were added. Of course with a more elegant way than writing it out myself... array[0].x += 5, array[1], array[2], array[3] etc. Ideally I would like this to go up to 500 or more array objects for one array so obviously I don't want to be writing it out individually haha, I also need it to be consistent with performance so using a for loop or something to loop through the whole array and move each x += 5 wouldn't work would it? Anyway, if anyone has any ideas that'd be great!

    Read the article

< Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >