[Flashcoders] Unique array AS3

2011-01-13 Thread natalia Vikhtinskaya
Hi I use function that creates unique array function uniqueRandomInt(min:Number, max:Number, n:Number) { var a:Array = []; var i:Number = min; while (a.push(i++)max) { ;

[Flashcoders] Android development using Flash/Flex

2011-01-13 Thread Andrew Sinning
A recent comment from Anthony Pace reads If you would prefer I help kick off the new year by asking some stupid questions, rather than Google the answers, I will gladly accommodate you. Here's one for you guys. I'm trying to find some good literature on what the options are for developing

Re: [Flashcoders] Unique array AS3

2011-01-13 Thread Juan Pablo Califano
Try this: function uniqueRandomInt(min:Number, max:Number, n:Number) { var a:Array = []; var i:Number = min; while (a.push(i++)max); a.sort(function (a:Number, b:Number) { return Math.floor(Math.random()*3)-1; }); return a.slice(0,n); } Although a random sort is not the best means to

Re: [Flashcoders] Unique array AS3

2011-01-13 Thread Juan Pablo Califano
PS: I mentioned that a random sort was not the best approach. Here's a better way to randomize an array: public static function shuffle(array:Array):void { var tmp:*; var cur:int; var top:int; cur = top = array.length; if(top) { while(--top) { cur =

Re: [Flashcoders] Unique array AS3

2011-01-13 Thread natalia Vikhtinskaya
Thank you very much!! Now it works well. 2011/1/13 Juan Pablo Califano califa010.flashcod...@gmail.com: Try this: function uniqueRandomInt(min:Number, max:Number, n:Number) {  var a:Array = [];  var i:Number = min;  while (a.push(i++)max);  a.sort(function (a:Number, b:Number) {  return

Re: [Flashcoders] Unique array AS3

2011-01-13 Thread natalia Vikhtinskaya
THANK YOU AGAIN!!! 2011/1/13 Juan Pablo Califano califa010.flashcod...@gmail.com: PS: I mentioned that a random sort was not the best approach. Here's a better way to randomize an array: public static function shuffle(array:Array):void {    var tmp:*;    var cur:int;    var top:int;  

Re: [Flashcoders] Fullscreen Hardware Acceleration and Video Player Skins

2011-01-13 Thread David Bellerive
That was my first test. The old FLVPlayback component supports hardware accelerated fullscreen video (using the Stage.fullScreenSourceRect property) but does distort the skin. It also provides a skinScaleMax property but that's useless since it cuts back on the benefits of using the hardware

[Flashcoders] from AS2 to AS3

2011-01-13 Thread natalia Vikhtinskaya
I need to convert game from AS2 to AS3. This game has movie clip “_items” on the stage with frames. Each frame has different mc. frame 1- has mc “item1” frame 2- has mc |”item2” … _items.gotoAndStop(2) trace(_items.item2) // for AS2 it gives mc In AS3 it gives none (it works correctly only

Re: [Flashcoders] from AS2 to AS3

2011-01-13 Thread Deepanjan Das
You may try using getChildByName(instance name); also. var mc:MovieClip=_items.getChildByName(item2); -- Warm Regards Deepanjan Das W: http://deepanjandas.wordpress.com || Om Manasamarthadata Shri Aniruddhaya Namah || *Think of the environment before printing this email * On Thu, Jan 13,

Re: [Flashcoders] from AS2 to AS3

2011-01-13 Thread Deepanjan Das
Hi, Is the item2 placed on first frame in item1? Warm Regards Deepanjan Das W: http://deepanjandas.wordpress.com On Thu, Jan 13, 2011 at 9:15 PM, natalia Vikhtinskaya natavi.m...@gmail.com wrote: It is still null 2011/1/13 Deepanjan Das deepanjan@gmail.com: You may try using

Re: [Flashcoders] from AS2 to AS3

2011-01-13 Thread Deepanjan Das
I mean item2 placed in first frame of _item? DD On Thu, Jan 13, 2011 at 9:18 PM, Deepanjan Das deepanjan@gmail.comwrote: Hi, Is the item2 placed on first frame in item1? Warm Regards Deepanjan Das W: http://deepanjandas.wordpress.com On Thu, Jan 13, 2011 at 9:15 PM, natalia

Re: [Flashcoders] Unique array AS3

2011-01-13 Thread Juan Pablo Califano
No problem! 2011/1/13 natalia Vikhtinskaya natavi.m...@gmail.com THANK YOU AGAIN!!! 2011/1/13 Juan Pablo Califano califa010.flashcod...@gmail.com: PS: I mentioned that a random sort was not the best approach. Here's a better way to randomize an array: public static function

Re: [Flashcoders] from AS2 to AS3

2011-01-13 Thread Deepanjan Das
Thats why you are getting a null value as the time when the script is executing, the frame 2 of _item is not available. For this you need to execute the script once you are sure the fame 2 of _item has loaded. Warm Regards Deepanjan Das On Thu, Jan 13, 2011 at 9:24 PM, natalia Vikhtinskaya

Re: [Flashcoders] from AS2 to AS3

2011-01-13 Thread Deepanjan Das
So you check for null before executing the script: addEventListener( Event.ENTER_FRAME, onEnterFrameHandler, false, 0, true ); var mc:MovieClip; function onEnterFrameHandler( event:Event ):void{ mc=_items.getChildByName(item2); if( mc ){ removeEventListener( Event.ENTER_FRAME,

[Flashcoders] Subtle XML/Font loading/CSS issue, limited test capabilities - looking for suggestions

2011-01-13 Thread Chris Foster
Folks, I'm currently working on a large eLearning project... hundreds of static (ugh!) screens. We're using the Gaia framework with great success. I've built a CS4 text display component that our designers use (uses component parameters pointing to external XML, CSS and font files, displays

Re: [Flashcoders] Subtle XML/Font loading/CSS issue, limited test capabilities - looking for suggestions

2011-01-13 Thread Karl DeSaulniers
have you tried embedding your fonts in your css? this might help in that. http://fontsquirrel.com/fontface/generator I use the bulletproof(smiley) Best, Karl Sent from my iPhone On Jan 13, 2011, at 6:07 PM, Chris Foster cfos...@catalystinteractive.com.au wrote: Folks, I'm currently

Re: [Flashcoders] Subtle XML/Font loading/CSS issue, limited test capabilities - looking for suggestions

2011-01-13 Thread Karl DeSaulniers
not sure why the double post.. my apologies. On Jan 13, 2011, at 6:37 PM, Karl DeSaulniers wrote: have you tried embedding your fonts in your css? this might help in that. http://fontsquirrel.com/fontface/generator I use the bulletproof(smiley) Best, Karl Sent from my iPhone On Jan 13,

RE: [Flashcoders] Subtle XML/Font loading/CSS issue, limited test capabilities - looking for suggestions

2011-01-13 Thread Chris Foster
No, thanks Karl, I haven't tried that... C: -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Karl DeSaulniers Sent: Friday, 14 January 2011 11:37 AM To: Flash Coders List Cc: Flash Coders List Subject: Re:

[Flashcoders] AIR for Android - video on mobile problem.

2011-01-13 Thread confustic...@gmail.com
Hey folks, Firstly, would anyone know if there is a list similar to flashcoders specifically for AIR for Android questions? I wouldn't want to annoy any flashcoders with my questions if this is the wrong place to ask them. I have tried out the Adobe forums, but the community there seems quite a

Re: [Flashcoders] AIR for Android - video on mobile problem.

2011-01-13 Thread Dave Watts
Firstly, would anyone know if there is a list similar to flashcoders specifically for AIR for Android questions? I don't know if there's one just for AIR on Android. But there is a good AIR list, called AIR-Tight. http://groups.google.com/group/air-tight?hl=en Dave Watts, CTO, Fig Leaf