[Papervision3D] simple component problem

hsafeer h.ksafeer at gmail.com
Thu Oct 4 19:45:14 PDT 2007


OK I've narrowed down the problem ..
It seems like the Inspectable new value is being set after the component has
been initialized.

If i add trace(mycomponent.flavorStr) on the 2nd frame, then I do see the
right value.
I also added a trace to the setter function. but it seems like the setter
function is firing after the component init/constructor code .

does anyone know why ??

thanks you in advance, Its a simple bug but i cant get my head around it . 
I might just need fresh eyes :)





hsafeer wrote:
> 
> Just tried it. no luck 
> 
> I even stripped everything including PV stuff. with same result .. i it
> always outputs the default value.
> Is there something i'm missing ? 
> 
> package
> {
> 	import fl.core.UIComponent;
> 	import flash.display.*;
> 	
> 	public class MyComponent extends UIComponent
> 	{		
> 		private var __flavorStr:String = "strawberry";
> 		[Inspectable(defaultValue="strawberry")]
> 		
> 		public function get flavorStr():String{
> 			return __flavorStr;
> 		}
> 		public function set flavorStr(newFlavor:String) {
> 			__flavorStr = newFlavor;
> 		}
> 
> 		public function MyComponent()
> 		{
> 			super();
>                         trace("--> "+ [__flavorStr, flavorStr]);
> 		}
> 	}
> }
> 
> Tim Knip-2 wrote:
>> 
>> Try deleting the ASO files, I suspect this is some caching problem?
>> 
>> in CS3: 'Control => Delete ASO'
>> 
>> Tim
>> 
>> 2007/10/4, hsafeer <h.ksafeer at gmail.com>:
>>>
>>> I'm working on a custom component for pv3d in as3.
>>> but I cant get it to read my parameters, on runtime. (i can see
>>> parameters
>>> in livePreview mode).
>>>
>>>
>>>         private var __flavorStr:String = "strawberry";
>>>         [Inspectable(defaultValue="strawberry")]
>>>
>>>         public function get flavorStr():String{
>>>             return __flavorStr;
>>>         }
>>>         public function set flavorStr(newFlavor:String) {
>>>             __flavorStr = newFlavor;
>>>         }
>>>
>>> now if i change the value of flavorStr from "strawberry" to somthing
>>> else,
>>> it still shows the value as "strawberry".
>>>
>>> ie ..
>>> component constructor () {
>>>        trace(flavorStr) OR trace(__flavorStr)
>>> }
>>>
>>> outputs "strawberry"; after changing it in the component inspector to
>>> something else .
>>>
>>> please help
>>>
>>> thankyou
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/simple-component-problem-tf4571601.html#a13049149
>>> Sent from the Papervision3D mailing list archive at Nabble.com.
>>>
>>>
>>> _______________________________________________
>>> Papervision3D mailing list
>>> Papervision3D at osflash.org
>>> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
>>>
>> 
>> _______________________________________________
>> Papervision3D mailing list
>> Papervision3D at osflash.org
>> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/simple-component-problem-tf4571601.html#a13052603
Sent from the Papervision3D mailing list archive at Nabble.com.




More information about the Papervision3D mailing list