To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here


A Flash Developer Resource Site

Go Back   Flash Kit Community Forums > Product Support > Koolmoves

Reply
 
Thread Tools Search this Thread Display Modes
Old 11-30-2006, 03:44 PM   #1
HScott
Junior Member
 
Join Date: Mar 2006
Posts: 18
Text reflections

I need help how to make text reflection on shinny surface?
HScott is offline   Reply With Quote
Old 11-30-2006, 04:19 PM   #2
blanius
KoolMoves Moderator
 
blanius's Avatar
 
Join Date: Jul 2001
Location: Atlanta GA
Posts: 4,912
Couple of ideas.

1)Convert the text into a movieclip then duplicate it and flip it then open this second clip and add a rectangle over the text and apply a gradient fill will all white fills or what ever the background is then adjust transparency so it looks like a reflection.

2)Use flash 8 bitmapdata and create a copy and apply a matrix transform and then apply the bitmap data to the movieclip holding the text.
blanius is offline   Reply With Quote
Old 11-30-2006, 04:37 PM   #3
blanius
KoolMoves Moderator
 
blanius's Avatar
 
Join Date: Jul 2001
Location: Atlanta GA
Posts: 4,912
Here's some code from http://pixelfumes.blogspot.com/2005/...eflection.html
that you could adapt.

Code:
import flash.display.BitmapData;
import flash.geom.*;

var targetImgURL:String = "leaves.jpg";

//create the picture clip
this.createEmptyMovieClip("picture_mc",this.getNextHighestDepth());
picture_mc._visible = false;

//create the background
picture_mc.createEmptyMovieClip("background_mc",2);
var backgroundObj:BitmapData = new BitmapData(200, 200, false, 0x00FFFFFF);
picture_mc.background_mc.attachBitmap(backgroundObj, 1);

//create the image holder
this.picture_mc.createEmptyMovieClip("image_mc",3);
this.picture_mc.image_mc.loadMovie(targetImgURL);

//watch load
var loadWatch:Number = setInterval(checkLoad,200);

function checkLoad(){
	if(picture_mc.image_mc.getBytesLoaded() == picture_mc.image_mc.getBytesTotal() && picture_mc.image_mc.getBytesTotal() > 10 ){
		clearInterval(loadWatch);
		//size picture
		picture_mc.image_mc._width = 300;
		picture_mc.image_mc._height = 194;
		
		//size bg
		var padding:Number = 7;
		picture_mc.background_mc._width = picture_mc.image_mc._width + padding*2;
		picture_mc.image_mc._x = padding;
		picture_mc.background_mc._height = picture_mc.image_mc._height + padding*2;
		picture_mc.image_mc._y = padding;
		
		
		
		//create a bmp obj out of it
		var myBitmapData:BitmapData = new BitmapData(picture_mc._width, picture_mc._height, false, 0x00FFFFFF);
		myBitmapData.draw(picture_mc.image_mc);
		reflectPicture();
	}
}

function reflectPicture(){
	//get a copy of the image we loaded
	var myBitmapData:BitmapData = new BitmapData(picture_mc._width, picture_mc._height, false, 0x00FFFFFF);
	myBitmapData.draw(picture_mc);
	picture_mc.createEmptyMovieClip("reflect_mc",4);
	picture_mc.reflect_mc.attachBitmap(myBitmapData,1);
	picture_mc.reflect_mc._yscale = -100;
	picture_mc.reflect_mc._y = picture_mc._height;
	
	//create the gradient mask
	picture_mc.createEmptyMovieClip("gradientMask_mc",5);
	
	var fillType:String = "linear"
	var colors:Array = [0xFFFFFF, 0xFFFFFF];
	var alphas:Array = [100, 0];
	var ratios:Array = [0, 255];
	var matrix = {matrixType:"box", x:0, y:0, w:picture_mc._width, h:picture_mc._height/4, r:(90/180)*Math.PI};

	picture_mc.gradientMask_mc.beginGradientFill(fillType, colors, alphas, ratios, matrix, spreadMethod); 
		
	picture_mc.gradientMask_mc.moveTo(0, 0);
	picture_mc.gradientMask_mc.lineTo(0, picture_mc._height/2);
	picture_mc.gradientMask_mc.lineTo(picture_mc._width, picture_mc._height/2);
	picture_mc.gradientMask_mc.lineTo(picture_mc._width, 0);
	picture_mc.gradientMask_mc.lineTo(0, 0);
	picture_mc.gradientMask_mc.endFill();
	
	picture_mc.gradientMask_mc._y = picture_mc._height/2;
	
	picture_mc.reflect_mc.cacheAsBitmap = true;
	picture_mc.gradientMask_mc.cacheAsBitmap = true;
	
	picture_mc.reflect_mc.setMask(picture_mc.gradientMask_mc);
	
	//slight skew
	//trans = new flash.geom.Transform(picture_mc);
	//trans.matrix = new flash.geom.Matrix(1,-.02,0,1,0,0);
	
	//blur reflection

	
	//do the final positioning and add drag
	picture_mc._x = 400/2 - picture_mc._width /2;
	picture_mc._y = 80
	picture_mc.image_mc.onPress = function(){
		this._parent.startDrag(false,0,0,400-picture_mc._width,400-picture_mc._height/2);
	}
	picture_mc.image_mc.onRelease = picture_mc.image_mc.onReleaseOutside = function(){
		stopDrag();
	}
	 picture_mc.reflect_mc._alpha = 10;
	picture_mc._visible = true;
}

blur = new flash.filters.BlurFilter(10, 10, 2);
picture_mc.reflect_mc.filters=[blur];
	
var checkboxListener:Object = new Object();
checkboxListener.click = function(evt_obj:Object) {
 if (evt_obj.target.selected) {
  picture_mc.reflect_mc.filters=[blur];
 } else {
  picture_mc.reflect_mc.filters=[];
 }
};
blur_ch.addEventListener("click", checkboxListener);


var listenerObject:Object = new Object();
listenerObject.change = function(eventObject:Object) {
    picture_mc.reflect_mc._alpha = eventObject.target.value;
};
num_nstep.addEventListener("change", listenerObject);
blanius is offline   Reply With Quote
Old 12-01-2006, 09:13 AM   #4
HScott
Junior Member
 
Join Date: Mar 2006
Posts: 18
Thank you so much Bret.
HScott is offline   Reply With Quote
Old 12-01-2006, 05:02 PM   #5
dniezby
Senior Member
 
Join Date: Jul 2001
Location: Tinley Park, IL
Posts: 702
You can create the image you need in Gimp or some other type of graphics program without any code.

This is just a simply design to illustrate a point.


I create almost all of my graphical elements outside of KM and use KM to make it all work together.

Here are some other examples, I needed an old piece of paper so I made this:



or a folder


While KM is a VERY powerful alternative to flash, it does have it's limitations. Advanced imagery is one - if not the only - limitation that I have found.
__________________
My Sites: Gaming Site Nightshade Studios MyKM Tutorials

--------------------------------------------------
What I'm using: Gimp, Koolmoves, Sepy, HTML-Kit, Inkscape
dniezby is offline   Reply With Quote
Old 12-02-2006, 07:36 AM   #6
Stoke Laurie
That web bloke
 
Stoke Laurie's Avatar
 
Join Date: Jan 2006
Location: England
Posts: 869
Quote:
Originally Posted by dniezby
I create almost all of my graphical elements outside of KM and use KM to make it all work together.
I agree totally, I see Km as the theatre and I supply the backdrops.
Stoke Laurie is offline   Reply With Quote
Old 12-02-2006, 01:11 PM   #7
dniezby
Senior Member
 
Join Date: Jul 2001
Location: Tinley Park, IL
Posts: 702
That is a great analogy.
__________________
My Sites: Gaming Site Nightshade Studios MyKM Tutorials

--------------------------------------------------
What I'm using: Gimp, Koolmoves, Sepy, HTML-Kit, Inkscape
dniezby is offline   Reply With Quote
Old 12-11-2006, 07:17 PM   #8
ant_Z
Polak Maly
 
ant_Z's Avatar
 
Join Date: Jul 2006
Location: Poland
Posts: 438
Quote:
Originally Posted by Stoke Laurie
I agree totally, I see Km as the theatre and I supply the backdrops.
what can I say? so... when i make some new layouts i use (almost) ONLY KoolMoves. Its so easy and clearly, and also powerful, that i use it almost all the time. Im making only "aqua" buttons outside KM. but it doesnt matter.
__________________
http://www.mroofka.z.pl
ant_Z is offline   Reply With Quote
Old 12-12-2006, 12:10 PM   #9
xzerox_xzerox
Senior Member
 
Join Date: Sep 2005
Location: Gothenburg, Sweden
Posts: 357
i use imageprograms like photoshop and cinema 4d and then save as a png to get the background transparent works fine with km
__________________
/xzerox... Take a look at http://www.vmgcomputers.com/h75
xzerox_xzerox is offline   Reply With Quote
Reply

Go Back   Flash Kit Community Forums > Product Support > Koolmoves

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

Forum Jump


All times are GMT -4. The time now is 05:31 PM.


internet.commerce
Be a Commerce Partner
 »  »  »  »  »  »  »
 »  »  »  »  »  »
 

    

Acceptable Use Policy

internet.comMediabistrojusttechjobs.comGraphics.com

WebMediaBrands Corporate Info


Advertise | Newsletters | Feedback | Submit News

Legal Notices | Licensing | Permissions | Privacy Policy


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.