Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > Community Boards > Just for Kicks Challenges

Reply
 
Thread Tools Rate Thread Display Modes
Old 04-25-2006, 07:51 AM   #1
smartie_on_computer
just call me smartie
 
smartie_on_computer's Avatar
 
Join Date: Jan 2006
Location: New Zealand
Posts: 303
Send a message via MSN to smartie_on_computer
Default camera fun

smartie_on_computer is offline   Reply With Quote
Old 04-25-2006, 09:51 PM   #2
smartie_on_computer
just call me smartie
 
smartie_on_computer's Avatar
 
Join Date: Jan 2006
Location: New Zealand
Posts: 303
Send a message via MSN to smartie_on_computer
Default

here's my script:
ActionScript Code:
initialize(); output.attachVideo(cam); function initialize() {     list = new Array();     m = new Matrix();     m.scale((output._xscale/100), (output._yscale/100));     now = new BitmapData(output._width, output._height);     out = new BitmapData(output._width, output._height);     setInterval(this, "snap", 100); } function snap() {     now.draw(output, m);     done = now.clone();     done.draw(before, m, null, "difference");     done.threshold(done, done.rectangle, done.rectangle.topLeft, ">", 0xFF111111, 0xFF00FF00, 0x00FFFFFF, false);     list.push(done.clone());     if (list.length>max) {         list.shift().dispose();     }     var l = list.length;     var each = 255/l;     var g;     out.fillRect(out.rectangle, 0xFF000000);     before = now.clone();     for (var i = 0; i<l; ++i) {         g = each*i; out.threshold(list[i], out.rectangle, out.rectangle.topLeft, "==", 0xFF00FF00, (255 << 24 | 0 << 16 | g << 8 | 0), 0x00FFFFFF, false);     } } var balls:Array = new Array(); for (z=0; z<5; z++) {     balls[z] = _root["ball"+z]; } var CX = this.output._x; var CY = this.output._y; _root.onEnterFrame = function() {     for (w=0; w<5; w++) {         map.draw(out);         var clr = _root.map.getPixel(balls[w]._x-CX, balls[w]._y-CY);         if (clr<80000 and clr>50000) {             _root.balls[w].kill();             this.num_txt.text = clr;         }     }     this.num_txt.text = clr; }; this.cant_btn.onRelease = function(){     System.showSettings(3); }
sorry 56 lines fo code

Last edited by smartie_on_computer; 04-25-2006 at 10:02 PM..
smartie_on_computer is offline   Reply With Quote
Old 05-02-2006, 08:55 PM   #3
smartie_on_computer
just call me smartie
 
smartie_on_computer's Avatar
 
Join Date: Jan 2006
Location: New Zealand
Posts: 303
Send a message via MSN to smartie_on_computer
Default

sorry, forgot to say, needs flash 8 or higher

P.S. common. im waiting on some one to come up with ideas
smartie_on_computer is offline   Reply With Quote
Old 10-09-2006, 03:25 PM   #4
afaassen
Registered User
 
Join Date: Feb 2005
Posts: 1
Default

the code does nothing when i cut and paste it in the first frame of flash8.
Am i missing some files or objects i need to make before it works?

I am looking for a audio triggering through the camera movement

Thanks in advance
afaassen is offline   Reply With Quote
Old 10-21-2006, 03:19 AM   #5
icktoofay
Flash Programmer
 
Join Date: Sep 2006
Location: Juneau, Alaska
Posts: 381
Send a message via Skype™ to icktoofay
Default

i know this creation is awesome... but i don't have a webcam
...and could you post the fla? theres the code and theres the source

Last edited by icktoofay; 10-21-2006 at 03:22 AM..
icktoofay is offline   Reply With Quote
Old 10-25-2006, 05:13 AM   #6
mrVin
Registered User
 
Join Date: Oct 2006
Posts: 1
Default

ehehe nice one!
mrVin is offline   Reply With Quote
Old 10-29-2006, 09:21 PM   #7
smartie_on_computer
just call me smartie
 
smartie_on_computer's Avatar
 
Join Date: Jan 2006
Location: New Zealand
Posts: 303
Send a message via MSN to smartie_on_computer
Default

yea soruce is comming soon (once i find the fla)

sorry for the long wait :S
smartie_on_computer is offline   Reply With Quote
Old 11-07-2006, 07:28 PM   #8
crespito
Cabeza Metal
 
Join Date: Dec 2005
Posts: 1
Default Fla?

GREAT WORK!!!

do you have the fla file???

Ill post mi work as soon is finished, since i am working on something similar using collision detection
crespito is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Camera detection tarjinder80 Other Flash General Questions 1 06-30-2006 04:53 PM
Resize problem related to Flash Camera billingsgate Other Flash General Questions 0 07-02-2005 02:32 PM
Stopping Camera rflorico ActionScript 2.0 0 06-12-2005 02:59 PM
I need help with a camera pan! skier4467 ActionScript 1.0 (and below) 1 11-13-2004 11:46 PM
Have made own Camera class, AS2.0 loads built in Camera instead :( Solutions ? Amn ActionScript 2.0 10 01-20-2004 12:13 AM


All times are GMT. The time now is 07:57 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2009 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.