Return-Path: X-Original-To: apmail-flex-users-archive@www.apache.org Delivered-To: apmail-flex-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 77C6010E81 for ; Fri, 7 Feb 2014 10:31:55 +0000 (UTC) Received: (qmail 18195 invoked by uid 500); 7 Feb 2014 10:31:55 -0000 Delivered-To: apmail-flex-users-archive@flex.apache.org Received: (qmail 18172 invoked by uid 500); 7 Feb 2014 10:31:53 -0000 Mailing-List: contact users-help@flex.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@flex.apache.org Delivered-To: mailing list users@flex.apache.org Received: (qmail 18161 invoked by uid 99); 7 Feb 2014 10:31:52 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Feb 2014 10:31:52 +0000 X-ASF-Spam-Status: No, hits=2.8 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of marrtinmiko@gmail.com designates 209.85.217.180 as permitted sender) Received: from [209.85.217.180] (HELO mail-lb0-f180.google.com) (209.85.217.180) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Feb 2014 10:31:48 +0000 Received: by mail-lb0-f180.google.com with SMTP id n15so2517007lbi.11 for ; Fri, 07 Feb 2014 02:31:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=3JRFEMiYeZRRE6St6lbdXBrjHxKLxYznRnKs9XachNI=; b=n0UEt/VVY99XjFk8LZnopQdutsq9Kdu2ENPGRGVs8kU26Tf301hSC01srfD6cDJ1Gi ujCx3t3LHOZjzYKqnNu0tFW6UNhEYqcgZMJqDXZF2b8WhWKTxuMLSTrrcXgvwqpUzFul 43u7zCr0pud5UtH9rQn95lIPE8tHSgPl2LQzWMM1XM9uvOX8BL7rIRWXOUGbaJ2rpzZD ux7PigVjukvKjwAXvSX7KYU55siHTwsev03llxDS5wt72RTfluQNb4B/qlnYn3k+FbgC 7oaMsLLD+2DkSKA05NgO312kVDpI0sjKXr5XYtfa0X64u/yEz89tx1mdSLBXJ9ZLOioo 1h0A== MIME-Version: 1.0 X-Received: by 10.152.219.37 with SMTP id pl5mr5698656lac.36.1391769087088; Fri, 07 Feb 2014 02:31:27 -0800 (PST) Received: by 10.152.197.99 with HTTP; Fri, 7 Feb 2014 02:31:27 -0800 (PST) In-Reply-To: <2D76DB37-030D-4535-B8A8-21B14DB4711B@googlemail.com> References: <2095F5EBE04D59409DFCE91FFCEBF7AFAF29AEB2@EXMBX05.netplexity.local> <1391278968943-4739.post@n4.nabble.com> <1391443700180-4777.post@n4.nabble.com> <1391532540172-4811.post@n4.nabble.com> <6FCF88FE-EB5A-4E8C-B727-98381FFA578A@googlemail.com> <2D76DB37-030D-4535-B8A8-21B14DB4711B@googlemail.com> Date: Fri, 7 Feb 2014 11:31:27 +0100 Message-ID: Subject: Re: Can I Bind a SolidColor Fill Value? From: Martin Miko To: users@flex.apache.org Content-Type: multipart/alternative; boundary=001a113360440b9c7804f1ce7ebd X-Virus-Checked: Checked by ClamAV on apache.org --001a113360440b9c7804f1ce7ebd Content-Type: text/plain; charset=ISO-8859-1 Hi Chris, yeah, sorry my mistake, I wrote it hastily and forgot kinda important line there: *super.partAdded(partName, instance);* so the correct function should look like this: override protected function partAdded(partName:String, instance:Object):void { super. partAdded(partName, instance); if (partName == "thumb") { thumbInst = instance; } } Explanation: You are overriding inherited function, so you need to call the inherited one as well. That's the one used in the parent class, because it adds all click events and lots more. If you just override it and don't call super.partAdded() all this "magic behind the scenes" is not done and the slider is not clickable or movable. Hope it'll work now, if you have any other question, feel free to ask. BR, Martin On Fri, Feb 7, 2014 at 10:20 AM, Tintin <1955.mille.miglia@googlemail.com>wrote: > Hello Martin > > I'm inching closer! I looked carefully at my code again last night, > particularly at the passing of the presenter class to the Thumb Skin. I saw > that your example code in the customSlider_creationCompleteHandler you > assigned a new instance of SliderView_Presenter to variable 'p' and then > passed this to the 'presenter' property of the customSlider. What I needed > was to assign 'this' to 'p' in my SliderView_Presenter and pass it to the > customSlider. That done, as my buttonColour property changes in > SliderView_Presenter the Skin Rect fill colour, bound to the buttonColour > property, now changes. Yippee! > > However (and it was going so well!) the following function prevents the > HSlider button from moving: > > override protected function partAdded(partName:String, > instance:Object):void { > if (partName == "thumb") { > _thumbInst = instance; > } > > Can you suggest why the Thumb button is no longer draggable? > > Thank you. > > Chris > > > On 6 Feb 2014, at 17:12, Martin Miko [via Apache Flex Users] wrote: > > > Hi Chris, > > > > yes, basically the presenter variable defined in the thumb skin is done > > like this: > > > > > > > > > > > > you add these 3 lines, and then use the presenter.buttonColour in the > > component where you want to use it. > > > > BR, > > Martin Miko > > > > > > On Thu, Feb 6, 2014 at 10:28 AM, Tintin <[hidden email]>wrote: > > > > > Hi Martin > > > > > > Would you please explain one last point which I can't quite see. You > use > > > the following code in the custom HSlider: > > > > > > // injecting the presenter > > > public function set presenter(p:SliderView_Presenter):void { > > > _presenter = p; > > > > > > if (thumbInst) > > > thumbInst.skin.presenter = _presenter; > > > } > > > > > > Did you create a property named 'presenter' within the Thumb's skin > mxml > > > file to pass it the HSlider's presenter class? > > > > > > I can see that I need to pass the presenter to the Thumb's skin so > that I > > > can bind my Thumb Rect Fill Color property back to the uint property > > > defined in my SliderView_Presenter class, but I can't see quite how. > > > > > > Thanks > > > > > > Chris > > > > > > On 4 Feb 2014, at 18:49, Martin Miko [via Apache Flex Users] wrote: > > > > > > > Hi Chris, > > > > > > > > I guess you almost have it working now! :) As you wrote in your > previous > > > > message, you need to pass the SliderView_Presenter instance all the > way > > > > from the place where you created it, to the place where you want to > use > > > it > > > > (skin). If you pass that instance all the way to the thumb button's > skin, > > > > then you can use the data binding exactly in the way you wanted. > > > > > > > > > > > > BR, > > > > Martin Miko > > > > > > > > > > > > On Tue, Feb 4, 2014 at 5:49 PM, Tintin <[hidden email]>wrote: > > > > > > > > > Thank you for your considered replies. I'm starting to get it now. > > > > > > > > > > It looks as if you are creating a custom HSlider with additional > > > properties > > > > > named 'presenter' and 'thumbInst'. When the creationComplete event > is > > > > > called > > > > > you pass in the SliderView_Presenter class. When you Set the > presenter > > > > > property you check to ensure you have an instance of the 'thumb' > part > > > and > > > > > if > > > > > you do then you assign thumbInst.skin.presenter the instance of > > > > > SliderView_Presenter (this must have to be the same instance and > not > > > > > instantiate a new instance otherwise when a property in the > original > > > > > SliderView_Presenter class changes the skin will not see this > change?). > > > > > > > > > > This looks to me as if I first need to create a property within the > > > thumb > > > > > skin named 'presenter' so that I can set it with the > > > SliderView_Property > > > > > instance I'm passing in? > > > > > > > > > > In my SliderView_Presenter class I assign a property named > > > buttonColour a > > > > > uint value by default and when a parameter is passed in from the > host > > > web > > > > > page a simple switch function assigns the correct colour depending > on > > > the > > > > > parameter value passed in. How can I use this to update, say a > > > rectangle, > > > > > in > > > > > my skin please? > > > > > > > > > > Chris > > > > > > > > > > > > > > > > > > > > -- > > > > > View this message in context: > > > > > > > > > http://apache-flex-users.2333346.n4.nabble.com/Can-I-Bind-a-SolidColor-Fill-Value-tp4615p4811.html > > > > > Sent from the Apache Flex Users mailing list archive at Nabble.com. > > > > > > > > > > > > > > > > > If you reply to this email, your message will be added to the > discussion > > > below: > > > > > > > > http://apache-flex-users.2333346.n4.nabble.com/Can-I-Bind-a-SolidColor-Fill-Value-tp4615p4819.html > > > > To unsubscribe from Can I Bind a SolidColor Fill Value?, click here. > > > > NAML > > > > > > > > > > > > > > > > > > -- > > > View this message in context: > > > > http://apache-flex-users.2333346.n4.nabble.com/Can-I-Bind-a-SolidColor-Fill-Value-tp4615p4848.html > > > Sent from the Apache Flex Users mailing list archive at Nabble.com. > > > > > > > > > If you reply to this email, your message will be added to the discussion > below: > > > http://apache-flex-users.2333346.n4.nabble.com/Can-I-Bind-a-SolidColor-Fill-Value-tp4615p4854.html > > To unsubscribe from Can I Bind a SolidColor Fill Value?, click here. > > NAML > > > > > > -- > View this message in context: > http://apache-flex-users.2333346.n4.nabble.com/Can-I-Bind-a-SolidColor-Fill-Value-tp4615p4880.html > Sent from the Apache Flex Users mailing list archive at Nabble.com. > --001a113360440b9c7804f1ce7ebd--