<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Glossy buttons in pure as3 code</title>
	<atom:link href="http://todepoint.com/blog/2008/04/10/glossy-buttons-in-pure-as3-code/feed/" rel="self" type="application/rss+xml" />
	<link>http://todepoint.com/blog/2008/04/10/glossy-buttons-in-pure-as3-code/</link>
	<description>A blog about User Interface, User Experience, Design, Flash, Product management and all that goes in between.</description>
	<lastBuildDate>Mon, 12 Dec 2011 09:58:58 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Paul</title>
		<link>http://todepoint.com/blog/2008/04/10/glossy-buttons-in-pure-as3-code/#comment-1719</link>
		<dc:creator>Paul</dc:creator>
		<pubDate>Mon, 24 Oct 2011 13:09:45 +0000</pubDate>
		<guid isPermaLink="false">http://todepoint.com/blog/?p=46#comment-1719</guid>
		<description>If we re-define the drop shadow in line 90 as 


var myShade = new DropShadowFilter(myShadeDist,85,0x020202,0.5,myShadeBlur,myShadeBlur,5,5);

(I have changed the last 2 parameters from 1,1 to 5,5);

Then write lines 263 to 273 as

//////////////////////////////////////////


private function onButPress(ev:Event):void
		{			
			_typo.textColor = 0xCCCCCC;
			// apply New shade / bevel filter:
			var myShadeBlur = _rd/8;
			var myShadeDist = _rd/12;
			var myBevelBlur = _rd / 6;
			var myShade = new DropShadowFilter(myShadeDist,85,0x020202,0.5,myShadeBlur,myShadeBlur,0,0);
			var myBevel = new BevelFilter(3,325,0x000000,.3,0x000000,.3,myBevelBlur,myBevelBlur,1,2,&quot;outer&quot;,false);
			_glossBut.filters = [myShade, myBevel];
			
			///////////////////////////////////			 
		}
		private function onButUp(ev:Event):void
		{
			_typo.textColor = 0x000000;
			
			// apply original shade / bevel filter:
			var myShadeBlur = _rd/8;
			var myShadeDist = _rd/12;
			var myBevelBlur = _rd / 6;
			var myShade = new DropShadowFilter(myShadeDist,85,0x020202,0.5,myShadeBlur,myShadeBlur,5,5);
			var myBevel = new BevelFilter(3,325,0x000000,.3,0x000000,.3,myBevelBlur,myBevelBlur,1,2,&quot;outer&quot;,false);
			_glossBut.filters = [myShade, myBevel];
			
			
		}

///////////////////////

Then together with the changte in text colour it creates a VERY noticeable change in appearance on the button clearly indicating which button was pressed.

I am sure there are more elegent ways to achieve the same effect but still - not bad for a Newbie !

Paul

p.s. I will leave you in peace now. Go Well!!</description>
		<content:encoded><![CDATA[<p>If we re-define the drop shadow in line 90 as </p>
<p>var myShade = new DropShadowFilter(myShadeDist,85,0&#215;020202,0.5,myShadeBlur,myShadeBlur,5,5);</p>
<p>(I have changed the last 2 parameters from 1,1 to 5,5);</p>
<p>Then write lines 263 to 273 as</p>
<p>//////////////////////////////////////////</p>
<p>private function onButPress(ev:Event):void<br />
		{<br />
			_typo.textColor = 0xCCCCCC;<br />
			// apply New shade / bevel filter:<br />
			var myShadeBlur = _rd/8;<br />
			var myShadeDist = _rd/12;<br />
			var myBevelBlur = _rd / 6;<br />
			var myShade = new DropShadowFilter(myShadeDist,85,0&#215;020202,0.5,myShadeBlur,myShadeBlur,0,0);<br />
			var myBevel = new BevelFilter(3,325,0&#215;000000,.3,0&#215;000000,.3,myBevelBlur,myBevelBlur,1,2,&#8221;outer&#8221;,false);<br />
			_glossBut.filters = [myShade, myBevel];</p>
<p>			///////////////////////////////////<br />
		}<br />
		private function onButUp(ev:Event):void<br />
		{<br />
			_typo.textColor = 0&#215;000000;</p>
<p>			// apply original shade / bevel filter:<br />
			var myShadeBlur = _rd/8;<br />
			var myShadeDist = _rd/12;<br />
			var myBevelBlur = _rd / 6;<br />
			var myShade = new DropShadowFilter(myShadeDist,85,0&#215;020202,0.5,myShadeBlur,myShadeBlur,5,5);<br />
			var myBevel = new BevelFilter(3,325,0&#215;000000,.3,0&#215;000000,.3,myBevelBlur,myBevelBlur,1,2,&#8221;outer&#8221;,false);<br />
			_glossBut.filters = [myShade, myBevel];</p>
<p>		}</p>
<p>///////////////////////</p>
<p>Then together with the changte in text colour it creates a VERY noticeable change in appearance on the button clearly indicating which button was pressed.</p>
<p>I am sure there are more elegent ways to achieve the same effect but still &#8211; not bad for a Newbie !</p>
<p>Paul</p>
<p>p.s. I will leave you in peace now. Go Well!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul</title>
		<link>http://todepoint.com/blog/2008/04/10/glossy-buttons-in-pure-as3-code/#comment-1718</link>
		<dc:creator>Paul</dc:creator>
		<pubDate>Mon, 24 Oct 2011 12:57:08 +0000</pubDate>
		<guid isPermaLink="false">http://todepoint.com/blog/?p=46#comment-1718</guid>
		<description>By way of experiment I changed lines 263 to 273 in the class to;

private function onButPress(ev:Event):void
		{
			
			_typo.textColor = 0xCCCCCC;
			
			 
		}
		private function onButUp(ev:Event):void
		{
			_typo.textColor = 0x000000;
		}


The effect is that on clicking the button the button text changes colour while on releasing the button the text returns to its original colour. This creates a blink-like effect in the button and lets the user know it was clicked. Fairly simple - sure there are better ways to do it. Anyway GREAT !

Will try to see if I can rather remove the drop shadow to create the impression of depressing the button. 


Paul</description>
		<content:encoded><![CDATA[<p>By way of experiment I changed lines 263 to 273 in the class to;</p>
<p>private function onButPress(ev:Event):void<br />
		{</p>
<p>			_typo.textColor = 0xCCCCCC;</p>
<p>		}<br />
		private function onButUp(ev:Event):void<br />
		{<br />
			_typo.textColor = 0&#215;000000;<br />
		}</p>
<p>The effect is that on clicking the button the button text changes colour while on releasing the button the text returns to its original colour. This creates a blink-like effect in the button and lets the user know it was clicked. Fairly simple &#8211; sure there are better ways to do it. Anyway GREAT !</p>
<p>Will try to see if I can rather remove the drop shadow to create the impression of depressing the button. </p>
<p>Paul</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul</title>
		<link>http://todepoint.com/blog/2008/04/10/glossy-buttons-in-pure-as3-code/#comment-1717</link>
		<dc:creator>Paul</dc:creator>
		<pubDate>Mon, 24 Oct 2011 12:32:44 +0000</pubDate>
		<guid isPermaLink="false">http://todepoint.com/blog/?p=46#comment-1717</guid>
		<description>Thanks adi.

I did see what I thought were a few behaviour reacting listeners in the class so will experiment with it.

Must say these buttons are REALLY cool !


Paul</description>
		<content:encoded><![CDATA[<p>Thanks adi.</p>
<p>I did see what I thought were a few behaviour reacting listeners in the class so will experiment with it.</p>
<p>Must say these buttons are REALLY cool !</p>
<p>Paul</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: adi</title>
		<link>http://todepoint.com/blog/2008/04/10/glossy-buttons-in-pure-as3-code/#comment-1716</link>
		<dc:creator>adi</dc:creator>
		<pubDate>Mon, 24 Oct 2011 11:20:54 +0000</pubDate>
		<guid isPermaLink="false">http://todepoint.com/blog/?p=46#comment-1716</guid>
		<description>Hey Paul, happy to hear you got it working :)

I didn&#039;t implement any behavior reacting to mouse events, though there are listeners defined and also empty handler functions there, waiting just for that.

Feel free to add your own, any behavior you add in the class (in RoundGlossy.as) will affect all instances of the glossy button, any listener-function you attach to a specific instance (in Main.as) will affect only that instance. And you can combine, add over/out effects to ALL instances &amp; define a unique click listener to each instance.

A.</description>
		<content:encoded><![CDATA[<p>Hey Paul, happy to hear you got it working :)</p>
<p>I didn&#8217;t implement any behavior reacting to mouse events, though there are listeners defined and also empty handler functions there, waiting just for that.</p>
<p>Feel free to add your own, any behavior you add in the class (in RoundGlossy.as) will affect all instances of the glossy button, any listener-function you attach to a specific instance (in Main.as) will affect only that instance. And you can combine, add over/out effects to ALL instances &#038; define a unique click listener to each instance.</p>
<p>A.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul</title>
		<link>http://todepoint.com/blog/2008/04/10/glossy-buttons-in-pure-as3-code/#comment-1714</link>
		<dc:creator>Paul</dc:creator>
		<pubDate>Mon, 24 Oct 2011 11:06:02 +0000</pubDate>
		<guid isPermaLink="false">http://todepoint.com/blog/?p=46#comment-1714</guid>
		<description>Are the buttons supposed to change slightly in appearance to indicate a hit ?

Paul</description>
		<content:encoded><![CDATA[<p>Are the buttons supposed to change slightly in appearance to indicate a hit ?</p>
<p>Paul</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul</title>
		<link>http://todepoint.com/blog/2008/04/10/glossy-buttons-in-pure-as3-code/#comment-1713</link>
		<dc:creator>Paul</dc:creator>
		<pubDate>Mon, 24 Oct 2011 09:29:03 +0000</pubDate>
		<guid isPermaLink="false">http://todepoint.com/blog/?p=46#comment-1713</guid>
		<description>Hi adi

OK - So I needed to add a function which would be executed on clicking the button. my bad ! So I added a simple trace command and it WORKS !!

A beasutiful blue shiny button which traces out &quot;Hello&quot; on clicking.

Thanks for a VERY usefull bit of AS3 code here. Those buttons look fantastic. 

So I take it that your instructions;


1. Add this to your document class:

import com.adifeiwel.custom_ui.RoundGlossy;

2. Place the ‘com’ folder next to the .fla.

3. In Flash: File &gt; Publish Settings &gt; ActionScript 3.0 Settings &gt; Source path: click Browse button and select the ‘com’ folder.

Are a way to import a class into a project ? I have not seen it done before. 

Will now play with this and see how to change button colours and sizes etc.

Thanks a million for your patience.

regards

Paul</description>
		<content:encoded><![CDATA[<p>Hi adi</p>
<p>OK &#8211; So I needed to add a function which would be executed on clicking the button. my bad ! So I added a simple trace command and it WORKS !!</p>
<p>A beasutiful blue shiny button which traces out &#8220;Hello&#8221; on clicking.</p>
<p>Thanks for a VERY usefull bit of AS3 code here. Those buttons look fantastic. </p>
<p>So I take it that your instructions;</p>
<p>1. Add this to your document class:</p>
<p>import com.adifeiwel.custom_ui.RoundGlossy;</p>
<p>2. Place the ‘com’ folder next to the .fla.</p>
<p>3. In Flash: File &gt; Publish Settings &gt; ActionScript 3.0 Settings &gt; Source path: click Browse button and select the ‘com’ folder.</p>
<p>Are a way to import a class into a project ? I have not seen it done before. </p>
<p>Will now play with this and see how to change button colours and sizes etc.</p>
<p>Thanks a million for your patience.</p>
<p>regards</p>
<p>Paul</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: adi</title>
		<link>http://todepoint.com/blog/2008/04/10/glossy-buttons-in-pure-as3-code/#comment-1712</link>
		<dc:creator>adi</dc:creator>
		<pubDate>Mon, 24 Oct 2011 08:52:51 +0000</pubDate>
		<guid isPermaLink="false">http://todepoint.com/blog/?p=46#comment-1712</guid>
		<description>Hey Paul, we&#039;re getting there!

&#039;clickHandler&#039; should be a function handling the click event, you can add something like this:

private function clickHandler(ev:MouseEvent):void
{
// do something?
}

This should clear the error, but now you have to think what it should do..</description>
		<content:encoded><![CDATA[<p>Hey Paul, we&#8217;re getting there!</p>
<p>&#8216;clickHandler&#8217; should be a function handling the click event, you can add something like this:</p>
<p>private function clickHandler(ev:MouseEvent):void<br />
{<br />
// do something?<br />
}</p>
<p>This should clear the error, but now you have to think what it should do..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul</title>
		<link>http://todepoint.com/blog/2008/04/10/glossy-buttons-in-pure-as3-code/#comment-1711</link>
		<dc:creator>Paul</dc:creator>
		<pubDate>Mon, 24 Oct 2011 08:44:03 +0000</pubDate>
		<guid isPermaLink="false">http://todepoint.com/blog/?p=46#comment-1711</guid>
		<description>Sorry ! 

Sorted that out but then got the following errors;

C:\Flash AS3\Glossy Buttons\adi\Main.as, Line 19	1120: Access of undefined property MouseEvent.

and

C:\Flash AS3\Glossy Buttons\adi\Main.as, Line 19	1120: Access of undefined property clickHandler.


Managed to sort the first error out by adding;

import flash.events.MouseEvent

to Main.as

But still getting the error about the clickHandler


Paul</description>
		<content:encoded><![CDATA[<p>Sorry ! </p>
<p>Sorted that out but then got the following errors;</p>
<p>C:\Flash AS3\Glossy Buttons\adi\Main.as, Line 19	1120: Access of undefined property MouseEvent.</p>
<p>and</p>
<p>C:\Flash AS3\Glossy Buttons\adi\Main.as, Line 19	1120: Access of undefined property clickHandler.</p>
<p>Managed to sort the first error out by adding;</p>
<p>import flash.events.MouseEvent</p>
<p>to Main.as</p>
<p>But still getting the error about the clickHandler</p>
<p>Paul</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: adi</title>
		<link>http://todepoint.com/blog/2008/04/10/glossy-buttons-in-pure-as3-code/#comment-1709</link>
		<dc:creator>adi</dc:creator>
		<pubDate>Sun, 23 Oct 2011 21:23:06 +0000</pubDate>
		<guid isPermaLink="false">http://todepoint.com/blog/?p=46#comment-1709</guid>
		<description>I think you have a special character there, in the second parameter, × instead of x..  :)</description>
		<content:encoded><![CDATA[<p>I think you have a special character there, in the second parameter, × instead of x..  :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul</title>
		<link>http://todepoint.com/blog/2008/04/10/glossy-buttons-in-pure-as3-code/#comment-1708</link>
		<dc:creator>Paul</dc:creator>
		<pubDate>Sun, 23 Oct 2011 20:18:01 +0000</pubDate>
		<guid isPermaLink="false">http://todepoint.com/blog/?p=46#comment-1708</guid>
		<description>This is my document class

package  
{   
    import flash.display.MovieClip;
    import com.adifeiwel.custom_ui.RoundGlossy;

    public class Main extends MovieClip   
    {   
        var blue:RoundGlossy = new RoundGlossy(30, 0×006699, 0x00FFFF);
  
        public function Main()   
        {   
            blue.x = 100;
			blue.y = 100;
			blue.setCaption(&quot;GO&quot;);
			blue.addEventListener(MouseEvent.CLICK, clickHandler);
			addChild(blue);

        }   
  
            }   
}  


I am getting the following error messages all associated with line 9;

C:\Flash AS3\Glossy Buttons\adi\Main.as, Line 9	1093: Syntax error.

C:\Flash AS3\Glossy Buttons\adi\Main.as, Line 9	1084: Syntax error: expecting rightparen before 006699.

where line 9 is the line;


var blue:RoundGlossy = new RoundGlossy(30, 0×006699, 0x00FFFF);

Did everything you suggested as far as I know.

Any ideas ?</description>
		<content:encoded><![CDATA[<p>This is my document class</p>
<p>package<br />
{<br />
    import flash.display.MovieClip;<br />
    import com.adifeiwel.custom_ui.RoundGlossy;</p>
<p>    public class Main extends MovieClip<br />
    {<br />
        var blue:RoundGlossy = new RoundGlossy(30, 0×006699, 0x00FFFF);</p>
<p>        public function Main()<br />
        {<br />
            blue.x = 100;<br />
			blue.y = 100;<br />
			blue.setCaption(&#8220;GO&#8221;);<br />
			blue.addEventListener(MouseEvent.CLICK, clickHandler);<br />
			addChild(blue);</p>
<p>        }   </p>
<p>            }<br />
}  </p>
<p>I am getting the following error messages all associated with line 9;</p>
<p>C:\Flash AS3\Glossy Buttons\adi\Main.as, Line 9	1093: Syntax error.</p>
<p>C:\Flash AS3\Glossy Buttons\adi\Main.as, Line 9	1084: Syntax error: expecting rightparen before 006699.</p>
<p>where line 9 is the line;</p>
<p>var blue:RoundGlossy = new RoundGlossy(30, 0×006699, 0x00FFFF);</p>
<p>Did everything you suggested as far as I know.</p>
<p>Any ideas ?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

