Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-22-2007, 02:24 AM
Junior Member
 
Join Date: Oct 2007
Posts: 7
Default how to capture a image of a specified MovieClip

hi ,in our project ,we need to capture a image for a specified MovieClip.I have noticed the Image.CaptureMovie method ,but this method dosen't accept a parameter. it capture
the _root MovieClip. we can't set other MovieClip's visible property to false because the capture operation call by program in a interval.
thanks.
Reply With Quote
  #2 (permalink)  
Old 10-22-2007, 03:52 PM
Junior Member
 
Join Date: Jul 2003
Posts: 29
Default Re: how to capture a image of a specified MovieClip

hi,

you can check out this interesting project... http://www.quasimondo.com/archives/000572.php

Ariel.
Reply With Quote
  #3 (permalink)  
Old 10-23-2007, 01:19 AM
Junior Member
 
Join Date: Oct 2007
Posts: 7
Default Re: how to capture a image of a specified MovieClip

hi thanks.
I have read the post .but the encode in the flash side is a little slow.we need more effective way to capture a MovieClip and save it to a accesss DataBase included in the exe file produced by swfkit.
Reply With Quote
  #4 (permalink)  
Old 10-24-2007, 12:31 PM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re: how to capture a image of a specified MovieClip

You will have to specify the coordinates of the movieClip when using the Image.captureMovie method.
Reply With Quote
  #5 (permalink)  
Old 10-25-2007, 01:20 AM
Junior Member
 
Join Date: Oct 2007
Posts: 7
Default Re: how to capture a image of a specified MovieClip

I know I can specify a area to capture. but it is not what i need . because if the MovieClip I want to capture have transparent area it will capture the background.what i need is just capture a MovieClip.
May be I can use BitmapData to capture Image .then encode it to ByteArray.But how can I send ByteArray to FFish and save it to hard drive or database.Can FFish handle ByteArray from Actionscript ?
Reply With Quote
  #6 (permalink)  
Old 10-29-2007, 07:56 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re: how to capture a image of a specified MovieClip

Yes, the following sample shows how to save a bitmap file

http://www.topcmm.com/forum/index.ph...c=1721.0;id=89
Reply With Quote
  #7 (permalink)  
Old 10-30-2007, 12:43 PM
Member
 
Join Date: Oct 2004
Posts: 53
Default Re: how to capture a image of a specified MovieClip

will this project only work in flash 9.
as the the flash file throws some errors when exporting from flash 8
and i m using flash8 only
Reply With Quote
  #8 (permalink)  
Old 11-01-2007, 07:52 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re: how to capture a image of a specified MovieClip

Yes, the code is in as3. However, it should also work in as2, please just copy the actionscript function to a flash 8 movie.
Reply With Quote
  #9 (permalink)  
Old 11-01-2007, 01:06 PM
Member
 
Join Date: Oct 2004
Posts: 53
Default Re: how to capture a image of a specified MovieClip

no its not working
Reply With Quote
  #10 (permalink)  
Old 11-04-2007, 01:42 PM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re: how to capture a image of a specified MovieClip

It does work. The following is the actionscript 2 code that works well
Code:
stop();

import flash.external.*;
import flash.display.BitmapData;

// calling a ffish script function
function saveBitmap(width, height, data)
{
	return ExternalInterface.call("saveBitmap", width, height, data);
}

function onSave()
{
	var bitmapData = new BitmapData(myImage._width, myImage._height, false);
	bitmapData.draw(myImage);
	var dr:Array = new Array();
	var w, h;
	
	for (h = bitmapData.height - 1; h >= 0; h--)
	{
		for (w = 0; w < bitmapData.width; w++)
		{
			var color = bitmapData.getPixel(w, h);
			dr.push(color);
		}
	}
	
	trace(dr);
	saveBitmap(bitmapData.width, bitmapData.height, dr.toString());
}

saveBtn.addEventListener("click", onSave);
Reply With Quote
Reply

Was this information helpful?    Yes No



Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 04:36 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.