Re: [Flashcoders] random drawing

2008-06-29 Thread Ashim D'Silva
If you're using AS3, everything in your library that's set to export
for Actionscript will have a unique Class which you need to call to
instantiate it.
Use getDefinitionByName to turn a randomly selected string into a
class definitiion and then call it.

Example:

If your library has 50 objects and their named: Card1, Card2, Card3 and so on.

var cardName:String = "Card"+String(1 + uint(Math.random()*49));
var cardClass:Object = getDefinitionByName(cardName) as Object
var card:Sprite = new cardClass();

The last line you can substitue your classes and parameters. Then run
this code 7 times.

2008/6/30 Bassam M <[EMAIL PROTECTED]>:
> Hi
>
> I'm trying to make game in this game I have 50 movie clip in the library
> I want when I click on one button call draw i want to show 7 of this movie
> clips on the stage but i want to select randomly 7 of 50 or more or once i
> click draw i want to draw one card  by one random
> can anyone help me please how to do it
>
> Tank you
> Bassam
> ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>



-- 
Random Lines 3D
My online portfolio
www.therandomlines.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] random drawing

2008-06-29 Thread Bassam M
Hi

I'm trying to make game in this game I have 50 movie clip in the library
I want when I click on one button call draw i want to show 7 of this movie
clips on the stage but i want to select randomly 7 of 50 or more or once i
click draw i want to draw one card  by one random
can anyone help me please how to do it

Tank you
Bassam
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Calling super.apply

2008-06-29 Thread Fumio Nonaka

Is the following what you would like to do?
http://www.fumiononaka.com/TechNotes/Flash/FN0703001.html
*Sorry, the article is in Japanese.

package {
dynamic public class MyArray extends Array {;
public function MyArray(...args) {
if (args.length == 1 && !isNaN(args[0])) {
this.length = args[0];
} else {
push.apply(this, args);
}
}
}
}
_
Sidney de Koning wrote:
If i push my values; my class returns that current item, if i pass it  
through the constructor i get back an array.
I want to be able to do both; push items seperately and pass through  an 
whole array in its constructor.


Is there something i can like super.apply(this, args) ?

public dynamic class ArrayIterator extends Array
{
//
protected var _index:int;

public function ArrayIterator(...args)

{
super(args);
_index = 0;
}

What am i doing wrong here and what can i do to solve this?

--
Fumio Nonaka
mailto:[EMAIL PROTECTED]
http://www.FumioNonaka.com/
My books
Flash community
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] Re: [SOLVED] Help! Webcam + lineTo on mousemove = webcam freeze

2008-06-29 Thread Johnny Zen
The problem seems to be only in CS3 flash "Test Movie" - when
published in flash player in browser, there is no problem. I guess the
flash player within flash professional is not so optimised.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Document viewer

2008-06-29 Thread Jiri Heitlager

I don't think that Adobe is especially interested in promoting FlashPaper,
which is essentially a competitor or substitute for PDF.


What a same, because it has some nice features. Come to think of it, now 
with the PDF isnt possible to embed flash content and doesnt that open 
up a way to do some interesting flash stuff with a pdf.


Jiri

Dave Watts wrote:
It has been a year ago and I'd thought Adobe would have 
brrought out an update by now. Geuss not!


I don't think that Adobe is especially interested in promoting FlashPaper,
which is essentially a competitor or substitute for PDF.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

Fig Leaf Software provides the highest caliber vendor-authorized
instruction at our training centers in Washington DC, Atlanta,
Chicago, Baltimore, Northern Virginia, or on-site at your location.
Visit http://training.figleaf.com/ for more information!
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] Help! Webcam + lineTo on mousemove = webcam freeze

2008-06-29 Thread Johnny Zen
Hi all

I am writing an application where I have  a whiteboard and webcam.

When I freehand draw a lot using lineTo (sprite), the webcam freezes.

(Drawing.graphics.lineTo(sourcePt.xPos, sourcePt.yPos);) - on mousemove

Any idea why this would happen ?

When I am drawing like crazy, I can see my webcam start to slow down
and then it gives up. - almost like a processing bottleneck ?

Any help would be cool.


Thanks
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders