Problem with Plugin

Hi all :)

I am creating a TextureMap plugin (replace Gradient Ramp)Below you can see my work.

plugin textureMap DynamicWave
name:"Dynamic Wave"
classID:#(0x15d16131, 0x7020f847)
parameters main rollout:params
 sl_ramp type:#float default:50.0 ui:sl_ramp
 sp_n_amount type:#float default:0.0 ui:sp_n_amount
 sp_n_size type:#float default:1.0 ui:sp_n_size
 sp_n_phase type:#float default:0.0 ui:sp_n_phase
 sp_n_level type:#float default:4.0 ui:sp_n_level
 rd_n_type type:#integer default:1 ui:rd_n_type
 sp_n_low  type:#float default:0.0 ui:sp_n_low
 sp_n_high  type:#float default:1.0 ui:sp_n_high
 sp_n_smooth  type:#float default:0.0 ui:sp_n_smooth
 on sl_ramp changed val do delegate.Gradient_Ramp.flag__3.position = val
 on sp_n_amount set val do delegate.amount = val
 on sp_n_size set val do delegate.size = val
 on sp_n_phase set val do delegate.phase = val
 on sp_n_level set val do delegate.Levels = val
 on sp_n_low set val do delegate.Low_Threshold = val
 on sp_n_high set val do delegate.High_Threshold = val
 on sp_n_smooth set val do delegate.Threshold_Smoothing = val
 on rd_n_type changed state do
	 case rd_n_type.state of
	 1: delegate.Noise_Type = 0
	 2: delegate.Noise_Type = 1
	 3: delegate.Noise_Type = 2
)--end params
rollout params "Dynamic Wave Map Parameters" width:368 height:200
	groupBox grp_noise "Noise" pos:[8,48] width:310 height:80
	slider sl_ramp "" pos:[6,16] width:320 height:25 ticks:6 range:[0,100,50]
	spinner sp_n_amount "Amount:" pos:[55,72] width:72 height:16 range:[0.0,100,0.0] fieldwidth:50
	radioButtons rd_n_type "" pos:[146,72] width:100 height:16 labels:#("Reg", "Frac", "Turb") default:1 columns:3 
	spinner sp_n_size "Size:" pos:[10,104] width:88 height:16 range:[0.1,100,0.5] fieldwidth:40
	spinner sp_n_phase "Phase:" pos:[122,104] width:80 height:16 range:[0,100,0] fieldwidth:40 
	spinner sp_n_level "Levels:" pos:[200,104] width:104 height:16 range:[0,100,1] fieldwidth:40
	groupBox grp_n_thres "Noise Threshold" pos:[8,136] width:310 height:56
	spinner sp_n_low "Low:" pos:[18,160] width:80 height:16 range:[0.0,100,1.0] fieldwidth:40 
	spinner sp_n_high "High:" pos:[122,160] width:80 height:16 range:[0.0,100,1.0] fieldwidth:40 
	spinner sp_n_smooth "Smooth:" pos:[224,160] width:80 height:16 range:[0.0,100,0.0] fieldwidth:40 
on create do
	 delegate.coordinates.mappingType = 0
	 delegate.coordinates.mapping  = 0
)--end plugin


1) If you check the plugin, you may notice that some parameters (slider, radioButtons and Levels) do not work, even if it did everything right ... any idea ??

2) I would like to move the 3rd flag, but it is impossible

on sl_ramp changed val do delegate.Gradient_Ramp.flag__3.position = val

3) Why if I insert

delegate.gradient_ramp.flag__1.color = black 

the listner indicates that the delegate already exists creating an error. Why?

Any idea?

thanks for any replies :)