[flexcoders] Re: hSlider Thumb Skin positions incorrectly

Monday, December 19, 2011

 

::bump::

Anyone?

--- In flexcoders@yahoogroups.com, "stldvd" <stldvd@...> wrote:
>
> Hi All,
>
> I'm trying to skin the thumb of an hSlider component. Problems:
> 1) the thumb is resized to be pixelated and grainy.
> 2) Its position is incorrect. Instead of the new button being cleanly bisected by the track, it is just below the track, tangential to it. And (presumably because its registration point is at upper left) when I slide it all the way to the right, it goes off the end of the track until its left edge is at the track's right edge. This also messes up calculations for the hSlider.value property. Here's code for the entire test project:
> //HSliderTest.mxml:
> <?xml version="1.0" encoding="utf-8"?>
> <s:ViewNavigatorApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
> xmlns:s="library://ns.adobe.com/flex/spark" firstView="views.HSliderTestHomeView" applicationDPI="160">
> <fx:Declarations>
> <!-- Place non-visual elements (e.g., services, value objects) here -->
> </fx:Declarations>
> </s:ViewNavigatorApplication>
>
> //SliderSkin.mxml. Only modified the <s:Button tag at the end:
> <?xml version="1.0" encoding="utf-8"?>
> <s:SparkSkin xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark"
> xmlns:fb="http://ns.adobe.com/flashbuilder/2009" minHeight="11" alpha.disabled="0.5">
>
> <fx:Metadata>
> <![CDATA[
> /**
> * @copy spark.skins.spark.ApplicationSkin#hostComponent
> */
> [HostComponent("spark.components.HSlider")]
>
> ]]>
> </fx:Metadata>
>
> <fx:Script fb:purpose="styling">
> /* Define the skin elements that should not be colorized.
> For slider, the skin itself is colorized but the individual parts are not. */
>
> static private const exclusions:Array = ["track", "thumb"];
>
> /**
> * @private
> */
> override public function get colorizeExclusions():Array {return exclusions;}
>
> /**
> * @private
> */
> override protected function initializationComplete():void
> {
> useChromeColor = true;
> super.initializationComplete();
> }
> </fx:Script>
>
> <fx:Script>
> /**
> * @private
> */
> override protected function measure() : void
> {
> // Temporarily move the thumb to the left of the Slider so measurement
> // doesn't factor in its x position. This allows resizing the
> // HSlider to less than 100px in width.
> var thumbPos:Number = thumb.getLayoutBoundsX();
> thumb.setLayoutBoundsPosition(0, thumb.getLayoutBoundsY());
> super.measure();
> thumb.setLayoutBoundsPosition(thumbPos, thumb.getLayoutBoundsY());
> }
> </fx:Script>
>
> <s:states>
> <s:State name="normal" />
> <s:State name="disabled" />
> </s:states>
>
> <fx:Declarations>
> <!--- The tooltip used in the mx.controls.Slider control.
> To customize the DataTip's appearance, create a custom HSliderSkin class.-->
> <fx:Component id="dataTip">
> <s:DataRenderer minHeight="24" minWidth="40" y="-34">
> <s:Rect top="0" left="0" right="0" bottom="0">
> <s:fill>
> <s:SolidColor color="0x000000" alpha=".9"/>
> </s:fill>
> <s:filters>
> <s:DropShadowFilter angle="90" color="0x999999" distance="3"/>
> </s:filters>
> </s:Rect>
> <s:Label id="labelDisplay" text="{data}"
> horizontalCenter="0" verticalCenter="1"
> left="5" right="5" top="5" bottom="5"
> textAlign="center" verticalAlign="middle"
> fontWeight="normal" color="white" fontSize="11">
> </s:Label>
> </s:DataRenderer>
> </fx:Component>
> </fx:Declarations>
>
> <!--- The default skin class is HSliderTrackSkin.
> @copy spark.components.supportClasses.TrackBase#track
> @see spark.skins.spark.HSliderTrackSkin -->
> <s:Button id="track" left="0" right="0" width="11" height="11"
> tabEnabled="false"
> skinClass="spark.skins.spark.HSliderTrackSkin" />
>
> <!--- The default skin class is HSliderThumbSkin.
> @copy spark.components.supportClasses.TrackBase#thumb
> @see spark.skins.spark.HSliderThumbSkin -->
> <s:Button id="thumb" top="0" bottom="0" height="11" width="11" tabEnabled="false" skinClass="skins.SliderThumbSkin" />
> </s:SparkSkin>
>
> //SliderThumbSkin.mxml
>
> <?xml version="1.0" encoding="utf-8"?>
> <s:SparkButtonSkin xmlns:fx="http://ns.adobe.com/mxml/2009"
> xmlns:s="library://ns.adobe.com/flex/spark"
> xmlns:fb="http://ns.adobe.com/flashbuilder/2009"
> minWidth="21"
> minHeight="21"
> alpha.disabled="0.5">
>
> <fx:Metadata>
> <![CDATA[
> /**
> * @copy spark.skins.spark.ApplicationSkin#hostComponent
> */
> [HostComponent("spark.components.Button")]
> ]]>
> </fx:Metadata>
>
> <!-- states -->
> <s:states>
> <s:State name="up" />
> <s:State name="over" />
> <s:State name="down" />
> <s:State name="disabled" />
> </s:states>
> <s:Image source.up="assets/PurpleOnlyCircle60x60.png"
> source.over="assets/PurpleOnlyCircle60x60.png"
> source.down="assets/PurpleOnlyCircle60x60.png"
> source.disabled="assets/PurpleOnlyCircle60x60.png"
> width="60"
> height="60"/>
> </s:SparkButtonSkin>
>
> Can anyone can see why this doesn't display correctly?
>
> Thanks!
>

__._,_.___
Recent Activity:
MARKETPLACE

Stay on top of your group activity without leaving the page you're on - Get the Yahoo! Toolbar now.

.

__,_._,___

Re: [flexcoders] You are the product

 

Hmmm. I doubt that would be possible.


The problem has never been with compiling the code as such. Its about how the compiled code is finally "used". Since we are going to be replacing  / removing the Flash Player from the picture, whether we compile the code on the server end or compile the code on the client end it really doesnt matter. 

On Mon, Dec 19, 2011 at 1:17 PM, Rick Winscot <rick.winscot@zyche.com> wrote:
 

Hmm… if Falcon is 10x faster than the previous compiler – could you incrementally feed it and have it emit to the browser? Kind of like a progressive download?


From: ganaraj p r <ganarajpr@gmail.com>
Reply-To: "flexcoders@yahoogroups.com" <flexcoders@yahoogroups.com>
Date: Mon, 19 Dec 2011 10:17:54 +0000
To: "flexcoders@yahoogroups.com" <flexcoders@yahoogroups.com>

Subject: Re: [flexcoders] You are the product

 

All that adobe needs to do is, start attempting to replace the current JS with AS3. 

Currently AS3 is a compiled language and JS is an interpreted language. Now can adobe come up with an interpreter for as3?
 


On Mon, Dec 19, 2011 at 9:40 AM, Peter Ginneberge <p.ginneberge@telenet.be> wrote:
 

> I really don't want to take a step back when I was
> in fact hoping to be getting a new version of
> action script that moved the main language even
> further forward.
>

I feel the same way. I just dislike JS and going from ActionScript to JavaScript is a step back.. a big one.
If you know Java, you're in luck 'cos with GWT you can just write Java apps and they get compiled to JS (with html/css) and you
still get to use Maven/Spring/Hibernate and do all the OOP stuff and whatnot. You don't have to look at javascript at all, let alone
write a single line of it !
As I mentioned earlier, if FlashBuilder would do something similar, I'd be all over it.
And it can be done, haXe already does that.
http://haxe.org/


regards,
Peter

----- Original Message -----
From: "Glenn Williams" <glenn@tinylion.co.uk>
To: <flexcoders@yahoogroups.com>
Sent: Sunday, December 18, 2011 6:45 PM
Subject: RE: [flexcoders] You are the product

> The samples are ok, but it's the actual langue I
> dislike.
>
>
>
> I just doesn't feel very complete to me.
>
>
>
> I really don't want to take a step back when I was
> in fact hoping to be getting a new version of
> action script that moved the main language even
> further forward.
>
>
>
> The whole situation just feels like a regression
> to me.
>
>
>
> From: flexcoders@yahoogroups.com
> [mailto:flexcoders@yahoogroups.com] On Behalf Of
> Rick Winscot
> Sent: 18 December 2011 01:29
> To: flexcoders@yahoogroups.com
> Subject: Re: [flexcoders] You are the product
>
>
>
>
>
> The charts? The dashboard? The app as a whole?
> Yes. I'd recommend looking into the ExtJS samples
> at Sencha.
>
>
>
> http://www.sencha.com/products/extjs/




--
Regards,
Ganaraj P R




--
Regards,
Ganaraj P R

__._,_.___
Recent Activity:
MARKETPLACE

Stay on top of your group activity without leaving the page you're on - Get the Yahoo! Toolbar now.

.

__,_._,___

Re: [flexcoders] You are the product

 

Hmm… if Falcon is 10x faster than the previous compiler – could you incrementally feed it and have it emit to the browser? Kind of like a progressive download?


From: ganaraj p r <ganarajpr@gmail.com>
Reply-To: "flexcoders@yahoogroups.com" <flexcoders@yahoogroups.com>
Date: Mon, 19 Dec 2011 10:17:54 +0000
To: "flexcoders@yahoogroups.com" <flexcoders@yahoogroups.com>
Subject: Re: [flexcoders] You are the product

 

All that adobe needs to do is, start attempting to replace the current JS with AS3. 

Currently AS3 is a compiled language and JS is an interpreted language. Now can adobe come up with an interpreter for as3?
 


On Mon, Dec 19, 2011 at 9:40 AM, Peter Ginneberge <p.ginneberge@telenet.be> wrote:
 

> I really don't want to take a step back when I was
> in fact hoping to be getting a new version of
> action script that moved the main language even
> further forward.
>

I feel the same way. I just dislike JS and going from ActionScript to JavaScript is a step back.. a big one.
If you know Java, you're in luck 'cos with GWT you can just write Java apps and they get compiled to JS (with html/css) and you
still get to use Maven/Spring/Hibernate and do all the OOP stuff and whatnot. You don't have to look at javascript at all, let alone
write a single line of it !
As I mentioned earlier, if FlashBuilder would do something similar, I'd be all over it.
And it can be done, haXe already does that.
http://haxe.org/


regards,
Peter

----- Original Message -----
From: "Glenn Williams" <glenn@tinylion.co.uk>
To: <flexcoders@yahoogroups.com>
Sent: Sunday, December 18, 2011 6:45 PM
Subject: RE: [flexcoders] You are the product

> The samples are ok, but it's the actual langue I
> dislike.
>
>
>
> I just doesn't feel very complete to me.
>
>
>
> I really don't want to take a step back when I was
> in fact hoping to be getting a new version of
> action script that moved the main language even
> further forward.
>
>
>
> The whole situation just feels like a regression
> to me.
>
>
>
> From: flexcoders@yahoogroups.com
> [mailto:flexcoders@yahoogroups.com] On Behalf Of
> Rick Winscot
> Sent: 18 December 2011 01:29
> To: flexcoders@yahoogroups.com
> Subject: Re: [flexcoders] You are the product
>
>
>
>
>
> The charts? The dashboard? The app as a whole?
> Yes. I'd recommend looking into the ExtJS samples
> at Sencha.
>
>
>
> http://www.sencha.com/products/extjs/




--
Regards,
Ganaraj P R

__._,_.___
Recent Activity:
MARKETPLACE

Stay on top of your group activity without leaving the page you're on - Get the Yahoo! Toolbar now.

.

__,_._,___