IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Flash Discussion :

[FLASH 8] [components] eventDispatcher


Sujet :

Flash

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre confirmé
    Inscrit en
    Février 2005
    Messages
    71
    Détails du profil
    Informations forums :
    Inscription : Février 2005
    Messages : 71
    Par défaut [FLASH 8] [components] eventDispatcher
    Bonjour et salut à tous..
    en fait mon problème est très bizarre ..
    j'ai une classe Slider.as dans laquelle je gère mon composant slider..
    et parmi les features de gestion du composant le fait de broadcaster mes custom events...
    le composant tourne bien.. je l'instancie sur mon fla et jusque là tous va bien... mais quand j'instancie ce composant dans une classe externe .. flash n'écoute plus mes évènements...
    Je ne trouve aucune explication à ce problème étrange..
    Je demande si quelqu'un de vous a rencontré un probleme pareil et qui puisse m'aider..
    merci d'avance

  2. #2
    Membre expérimenté Avatar de younes_
    Profil pro
    Inscrit en
    Juin 2005
    Messages
    229
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juin 2005
    Messages : 229
    Par défaut Re: [FLASH 8] [components] eventDispatcher
    Salut,
    Est ce qu'on peut voir comment tu utilises le composants dans la classe? peut être que le probléme vient du la porté de ton évenement.
    A+

  3. #3
    Membre confirmé
    Inscrit en
    Février 2005
    Messages
    71
    Détails du profil
    Informations forums :
    Inscription : Février 2005
    Messages : 71
    Par défaut
    pour le dispatch:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    	private function __do_properties ()
    	{
    		mc_arrow_1.onPress = function ()
    		{EventDispatcher.initialize (this);
    			this._parent.dispatchEvent ( 
    			{
    				type : "pressed", target : this._parent, changed : 1
    			});
    mc_arrow_1.onRelease = function ()
    		{
    			if (this.oldvalue != this.lock_point)
    			{
    				this._parent.dispatchEvent ( 
    				{
    					type : "changed", target : this._parent, changed : this._name == "arrow_1" ? 1 : 2
    				});
    			}
    et pour l'instanciation dans la classe:


    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    import mx.utils.Delegate;
    import mx.core.UIComponent;
    class SliderManager extends MovieClip 
    {	private var myRestrictedSlider : MovieClip
    	private var reset_btn : MovieClip;
    	private var intBlocker : MovieClip;
    	private var insertLog_btn : MovieClip;
    	private var mainSlider_mc : MovieClip;
    	private var indicators : MovieClip;
    	private var originalMessage_input:mx.controls.TextInput;
    	private var alreadyInserted:Boolean;
    	private var prevPos:Number;
    	private var pos:Number;
    	private var addEventListener:Function;
    	function SliderManager ()
    	{
    		super ();
    	}
    	function insertSlider (__x:Number, __y:Number, __width:Number, mcSource:MovieClip, depth:Number)
    	{
    		var _input:mx.controls.TextInput=mcSource.createClassObject(mx.controls.TextInput,"_input",depth++)
    		_input.move(9.9,117.3);
    		_input.setSize(368.6,22);
    		myRestrictedSlider = mcSource.attachMovie ("sliderHolder", "myRestrictedSlider", depth++);
     
    		myRestrictedSlider.slider_mc._width = __width;
    		myRestrictedSlider._x = __x;
    		myRestrictedSlider._y = __y;
    		myRestrictedSlider.slider_mc.setStyle ("lineColor", 0xCCCCCC);
     
    		_input.addEventListener("change", Delegate.create(this, updateSteps));
    		myRestrictedSlider.slider_mc.addEventListener("pressed", Delegate.create(this,getSelection));
    		myRestrictedSlider.slider_mc.addEventListener("changed",   Delegate.create(manageSelection));
    		return myRestrictedSlider;
    	}
    function manageSelection(){
    	trace("managing")
    }
    function getSelection(){
    	trace("getting")
    }
    function updateSteps(evt:Object){
    	evt.target._parent.myRestrictedSlider.slider_mc.steps = evt.target.length;
    	trace(evt.target._parent.myRestrictedSlider)
    }
     
    }

  4. #4
    Membre confirmé
    Inscrit en
    Février 2005
    Messages
    71
    Détails du profil
    Informations forums :
    Inscription : Février 2005
    Messages : 71
    Par défaut
    pas de solution les developers.. aidez moi je suis vraiment bloqué

  5. #5
    Membre expérimenté Avatar de younes_
    Profil pro
    Inscrit en
    Juin 2005
    Messages
    229
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juin 2005
    Messages : 229
    Par défaut
    Salut,
    Utilise Delegate pour dispatcher les évenements comme tu as fait pour SliderManager, ça évite à utiliser des chemins relative et avoir un code plus clair.

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
     
    // Classe constructor
    public function Slider()
    {
    EventDispatcher.initialize (this);
    }
    private function __do_properties ()
    {
          //il faut vérifier si les buttons sont bien accessible içi
          // trace(mc_arrow)
          // déléguer les évenements des buttons vers des méthodes de la classe
          mc_arrow_1.onPress = Delegate.create(this, mc_arrow1_press);
          mc_arrow_1.onRelease = Delegate.create(this,mc_arrow1_release) 
    }
    private function mc_arrow1_press():Void
    {
    dispatchEvent ({type : "pressed", target : this, changed : 1});
     }
    private function mc_arrow1_release():Void
    {
       /* 
        * Ces deux variables doivent être instancier dans la classe
        * pour pouvoir les utiliser
        */
       if (oldvalue != lock_point)
       {
             dispatchEvent (
                {
                   type : "changed", target : this._parent, changed : 1
                });
         }
    }
    a+

  6. #6
    Membre confirmé
    Inscrit en
    Février 2005
    Messages
    71
    Détails du profil
    Informations forums :
    Inscription : Février 2005
    Messages : 71
    Par défaut
    bonjour
    j'ai fait ce que tu as proposé mais ça n'a pas marché
    pour clarifier de plus les choses voici l'ancien script:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
     
    import mx.events.EventDispatcher;
    import mx.core.UIComponent;
     
    class as.componentMgmt.Slider extends  UIComponent
    {
    	var addEventListener : Function;
    	var removeEventListener : Function;
    	var dispatchEvent : Function;
    	var __width : Number;
    	var __height : Number;
    	var boundingBox_mc : MovieClip;
    	var mc_line : MovieClip;
    	var mc_arrow_1 : MovieClip;
    	var mc_arrow_2 : MovieClip;
    	static var _currentXPos:Number = 0;
    	var start_x : Number;
    	var end_x : Number;
    	var _min : Number = 0;
    	var _max : Number = 0;
    	var _steps : Number = 0;
    	var _arrow : String;
    	var _points : String;
    	var lockPoints : Array;
    	static var innerDepth : Number = 10;
    	static var _alreadyInserted : Boolean;
    	function Slider ()
    	{
    		_min = 0;
    		_max = 100;
    		_steps = 0;
    		EventDispatcher.initialize (this);
    	}
    	function init ():Void
    	{
    		super.init ();
     
    		boundingBox_mc._visible = false;
    	}
    	private function draw ():Void
    	{
    		__do_layout ();
    	}
    	private function size ():Void
    	{
    		super.size ();
    	}
    	private function createChildren ():Void
    	{
    		mc_line = this.createEmptyMovieClip ("line", 1);
    		mc_arrow_1 = this.attachMovie (_arrow != "" ? _arrow : "arrow_mc", "arrow_1", 2);
    		mc_arrow_2 = this.attachMovie (_arrow != "" ? _arrow : "arrow_mc", "arrow_2", 3);
    		//mc_arrow_2.removeMovieClip()
    		mc_arrow_2._visible = false;
    		start_x = mc_arrow_1._width / 2;
    		end_x = __width - start_x;
    		__do_properties ();
    	}
    	public function refresh ():Void
    	{
    		mc_line.removeMovieClip ();
    		mc_arrow_1.removeMovieClip ();
    		createChildren ();
    		__do_layout ();
    	}
    	private function __do_layout ():Void
    	{
    		mc_line = this.createEmptyMovieClip ("line", 1);
    		mc_line.clear ();
    		mc_line.lineStyle (0.1, this.getStyle ("lineColor") , 100);
    		mc_line.moveTo (start_x, Math.round (mc_arrow_1._height / 2));
    		mc_line.lineTo (end_x, Math.round (mc_arrow_1._height / 2));
    		var total_w:Number = mc_line._width;
    		var total:Number = _steps;
    		var point : MovieClip;
    		lockPoints = new Array ();
    		var a:Number;
    		for (a = 0; a <= total; a ++)
    		{
    			point = mc_line.attachMovie (_points != "" ? _points : "points_mc", "point_" + (a + 1) , (a + 1));
    			point._x = start_x - (point._width / 2) + total_w * (a / total);
    			if (this.getStyle ("displayPoints") == false)
    			{
    				point._visible = false;
    			}
    			point._y = Math.round (mc_arrow_1._height / 2) - point._height;
    			lockPoints.push ([start_x + total_w * (a / total) , _min + (a * steps)]);
    		}
    		mc_arrow_1.lock_point = 0;
    		mc_arrow_2.lock_point = lockPoints.length;
    		// -1 (pour restreindre le mca1_x par rapport à mca2_x)
    		mc_arrow_1._x = 0;
    		mc_arrow_2._x = end_x + 200;
    		//- mc_arrow_2._width/2
    	}
    	private function __do_properties ():Void
    	{
    		mc_arrow_1.onPress = function ()
    		{
    			this._parent.dispatchEvent ( 
    			{
    				type : "pressed", target : this._parent, changed : 1
    			});
     
    			this.pressed = true;
    			this.oldvalue = this.lock_point
    			if (this._parent.mc_arrow_2.getDepth () > this.getDepth ()) this.swapDepths (this._parent.mc_arrow_2)
    			this.onMouseMove = function ()
    			{
    				var _mx = this._parent.__get_x (this._parent._xmouse, 1)
    				if (_mx [1] != undefined && _mx [1] > Slider._currentXPos)
    				{
    					/*****************/
    					var oldx = this._x;
    					this._x = _mx [1] - this._width / 2;
    					this.lock_point = _mx [0];
    					if (_mx [1] - this._width / 2 != oldx)
    					{
    						this._parent.dispatchEvent ( 
    						{
    							type : "changing", target : this._parent, changed : 1
    						});
    					}
    				}
    				updateAfterEvent ();
    			}
    		}
    		mc_arrow_1.onRelease = function ()
    		{
    			if (this.oldvalue != this.lock_point)
    			{
    				this._parent.dispatchEvent ( 
    				{
    					type : "changed", target : this._parent, changed : this._name == "arrow_1" ? 1 : 2
    				});
    				//trace("waaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
     
    			}
    			delete this.onMouseMove;
    			this.pressed = false;
    		}
    		mc_arrow_1.onReleaseOutside = mc_arrow_1.onRelease;
    	}
    	private function __get_x (num : Number, which : Number) : Array
    	{
    		var avg : Number;
    		if (num >= 0 && num <= mc_line._width)
    		{
    			if (which == 2)
    			{
    				for (var a = lockPoints.length - 1; a > mc_arrow_1.lock_point; a --)
    				{
    					if (num <= lockPoints [a][0] && num >= lockPoints [a - 1][0])
    					{
    						return [a, lockPoints [a][0]];
    					}
    				}
    			} else
    			{
    				for (var a = 0; a < mc_arrow_2.lock_point; a ++)
    				{
    					if (num >= lockPoints [a][0] && num <= lockPoints [a + 1][0])
    					{
    						avg = lockPoints [a + 1][0] - lockPoints [a][0];
    						if (num - lockPoints [a][0] < avg / 2)
    						{
    							return [a, lockPoints [a][0]];
    						}
    					}
    				}
    			}
    		} 
    		else
    		{
    			if (num < 0)
    			{
    				if (which == 1)
    				{
    					return [0, lockPoints [0][0]];
    				} else
    				{
    					return [mc_arrow_1.lock_point + 1, lockPoints [mc_arrow_1.lock_point + 1][0]];
    				}
    			}
    			if (num > mc_line._width)
    			{
    				if (which == 2)
    				{
    					return [lockPoints.length - 1, lockPoints [lockPoints.length - 1][0]];
    				} else
    				{
    					return [mc_arrow_2.lock_point - 1, lockPoints [mc_arrow_2.lock_point - 1][0]];
    				}
    			}
    			return [undefined, undefined];
    		}
    	}
    	public function getValue () : Number //: Array
     
    	{
    		var x1 = mc_arrow_1.lock_point ;
    		return x1
    	}
    	[Inspectable(defaultValue=0,type="Number")]
    	public function set min (num : Number)
    	{
    		_min = num;
    	}
    	public function get min () : Number
    	{
    		return _min;
    	}
    	[Inspectable(defaultValue=0,type="Number")]
    	public function set max (num : Number)
    	{
    		_max = num;
    	}
    	public function get max () : Number
    	{
    		return _max;
    	}
    	[Inspectable(defaultValue=0,type="Number")]
    	public function set steps (num : Number)
    	{
    		_steps = num;
    		refresh ();
    	}
    	public function get steps () : Number
    	{
    		return _steps;
    	}
    	[Inspectable(defaultValue="",type="String")]
    	public function set arrow (value : String)
    	{
    		_arrow = value;
    		refresh ();
    	}
    	[Inspectable(defaultValue="",type="String")]
    	public function set points (value : String)
    	{
    		_points = value;
    		//refresh ();
     
    	}
    	public function set alreadyInserted (value : Boolean)
    	{
    		Slider._alreadyInserted = value;
    	}
    	public function get alreadyInserted () : Boolean
    	{
    		return Slider._alreadyInserted;
    	}
    }
    et voici le code dans lequel j'ai fait le refactorig que tu as proposé
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
     
    import mx.events.EventDispatcher;
    import mx.utils.Delegate;
    import mx.core.UIComponent;
    [Event("pressed")]
    [Event("changed")]
    [Event("changing")]
    class Slider extends  UIComponent
    {
    	var addEventListener : Function;
    	var removeEventListener : Function;
    	static var dispatchEvent : Function;
    	var __width : Number;
    	var __height : Number;
    	var boundingBox_mc : MovieClip;
    	var mc_line : MovieClip;
    	var mc_arrow_1 : MovieClip;
    	var mc_arrow_2 : MovieClip;
    	static var _currentXPos:Number = 0;
    	var start_x : Number;
    	var end_x : Number;
    	var _min : Number = 0;
    	var _max : Number = 0;
    	var _steps : Number = 0;
    	var _arrow : String;
    	var _points : String;
    	var lockPoints : Array;
    	var lock_point:Number;
    	var pressed:Boolean;
    	var oldvalue:Number;
    	static var innerDepth : Number = 10;
    	static var _alreadyInserted : Boolean;
    	function Slider ()
    	{
    		_min = 0;
    		_max = 100;
    		_steps = 0;
    		EventDispatcher.initialize (this);
    	}
    	function init ():Void
    	{
    		super.init ();
    		boundingBox_mc._visible = false;
    	}
    	private function draw ():Void
    	{
    		__do_layout ();
    	}
    	private function size ():Void
    	{
    		super.size ();
    	}
    	private function createChildren ():Void
    	{
    		mc_line = this.createEmptyMovieClip ("line", 1);
    		mc_arrow_1 = this.attachMovie (_arrow != "" ? _arrow : "arrow_mc", "arrow_1", 2);
    		mc_arrow_2 = this.attachMovie (_arrow != "" ? _arrow : "arrow_mc", "arrow_2", 3);
    		//mc_arrow_2.removeMovieClip()
    		mc_arrow_2._visible = false;
    		start_x = mc_arrow_1._width / 2;
    		end_x = __width - start_x;
    		__do_properties ();
    	}
    	public function refresh ():Void
    	{
    		mc_line.removeMovieClip ();
    		mc_arrow_1.removeMovieClip ();
    		createChildren ();
    		__do_layout ();
    	}
    	private function __do_layout ():Void
    	{
    		mc_line = this.createEmptyMovieClip ("line", 1);
    		mc_line.clear ();
    		mc_line.lineStyle (0.1, this.getStyle ("lineColor") , 100);
    		mc_line.moveTo (start_x, Math.round (mc_arrow_1._height / 2));
    		mc_line.lineTo (end_x, Math.round (mc_arrow_1._height / 2));
    		var total_w:Number = mc_line._width;
    		var total:Number = _steps;
    		var point : MovieClip;
    		lockPoints = new Array ();
    		var a:Number;
    		for (a = 0; a <= total; a ++)
    		{
    			point = mc_line.attachMovie (_points != "" ? _points : "points_mc", "point_" + (a + 1) , (a + 1));
    			point._x = start_x - (point._width / 2) + total_w * (a / total);
    			if (this.getStyle ("displayPoints") == false)
    			{
    				point._visible = false;
    			}
    			point._y = Math.round (mc_arrow_1._height / 2) - point._height;
    			lockPoints.push ([start_x + total_w * (a / total) , _min + (a * steps)]);
    		}
    		mc_arrow_1.lock_point = 0;
    		mc_arrow_2.lock_point = lockPoints.length;
    		// -1 (pour restreindre le mca1_x par rapport à mca2_x)
    		mc_arrow_1._x = 0;
    		mc_arrow_2._x = end_x + 200;
    		//- mc_arrow_2._width/2
    	}
    	private function mc_arrow1_press(evt:Object){
    		dispatchEvent (
    		{
    			target : this, type : "pressed"
    		});
    			pressed = true;
    			oldvalue = lock_point
    			trace(evt.target._parent)
    			if (this._parent.mc_arrow_2.getDepth () > this.getDepth ()) this.swapDepths (this._parent.mc_arrow_2)
    			this.onMouseMove = function ()
    			{
    				var _mx = evt.target._parent.__get_x (evt.target._parent._xmouse, 1)
    				if (_mx [1] != undefined && _mx [1] > Slider._currentXPos)
    				{
    					/*****************/
    					var oldx = this._x;
    					this._x = _mx [1] - this._width / 2;
    					lock_point = _mx [0];
    					if (_mx [1] - this._width / 2 != oldx)
    					{
    						dispatchEvent ( 
    						{
    							type : "changing", target : this, changed : 1
    						});
    					}
    				}
    				updateAfterEvent ();
    			}
    		}
    	private function mc_arrow1_release(){
     
    			if (oldvalue != lock_point)
    			{
    				this._parent.dispatchEvent ( 
    				{
    					type : "changed", target : this, changed : this._name == "arrow_1" ? 1 : 2
    				});
     
    			}
    			delete onMouseMove;
    			pressed = false;
    		}
    	private function __do_properties ():Void
    	{mc_arrow_1.onPress = Delegate.create(this, mc_arrow1_press); 
          mc_arrow_1.onRelease = Delegate.create(this,mc_arrow1_release) 
    	}
    	private function __get_x (num : Number, which : Number) : Array
    	{
    		var avg : Number;
    		if (num >= 0 && num <= mc_line._width)
    		{
    			if (which == 2)
    			{
    				for (var a = lockPoints.length - 1; a > mc_arrow_1.lock_point; a --)
    				{
    					if (num <= lockPoints [a][0] && num >= lockPoints [a - 1][0])
    					{
    						return [a, lockPoints [a][0]];
    					}
    				}
    			} else
    			{
    				for (var a = 0; a < mc_arrow_2.lock_point; a ++)
    				{
    					if (num >= lockPoints [a][0] && num <= lockPoints [a + 1][0])
    					{
    						avg = lockPoints [a + 1][0] - lockPoints [a][0];
    						if (num - lockPoints [a][0] < avg / 2)
    						{
    							return [a, lockPoints [a][0]];
    						}
    					}
    				}
    			}
    		} 
    		else
    		{
    			if (num < 0)
    			{
    				if (which == 1)
    				{
    					return [0, lockPoints [0][0]];
    				} else
    				{
    					return [mc_arrow_1.lock_point + 1, lockPoints [mc_arrow_1.lock_point + 1][0]];
    				}
    			}
    			if (num > mc_line._width)
    			{
    				if (which == 2)
    				{
    					return [lockPoints.length - 1, lockPoints [lockPoints.length - 1][0]];
    				} else
    				{
    					return [mc_arrow_2.lock_point - 1, lockPoints [mc_arrow_2.lock_point - 1][0]];
    				}
    			}
    			return [undefined, undefined];
    		}
    	}
    	public function getValue () : Number //: Array
     
    	{
    		var x1 = mc_arrow_1.lock_point ;
    		return x1
    	}
    	[Inspectable(defaultValue=0,type="Number")]
    	public function set min (num : Number)
    	{
    		_min = num;
    	}
    	public function get min () : Number
    	{
    		return _min;
    	}
    	[Inspectable(defaultValue=0,type="Number")]
    	public function set max (num : Number)
    	{
    		_max = num;
    	}
    	public function get max () : Number
    	{
    		return _max;
    	}
    	[Inspectable(defaultValue=0,type="Number")]
    	public function set steps (num : Number)
    	{
    		_steps = num;
    		refresh ();
    	}
    	public function get steps () : Number
    	{
    		return _steps;
    	}
    	[Inspectable(defaultValue="",type="String")]
    	public function set arrow (value : String)
    	{
    		_arrow = value;
    		refresh ();
    	}
    	[Inspectable(defaultValue="",type="String")]
    	public function set points (value : String)
    	{
    		_points = value;
    		//refresh ();
     
    	}
    	public function set alreadyInserted (value : Boolean)
    	{
    		Slider._alreadyInserted = value;
    	}
    	public function get alreadyInserted () : Boolean
    	{
    		return Slider._alreadyInserted;
    	}
    }

  7. #7
    Membre confirmé
    Inscrit en
    Février 2005
    Messages
    71
    Détails du profil
    Informations forums :
    Inscription : Février 2005
    Messages : 71
    Par défaut
    bonjour
    mon main problem est que je n'ai pas encore trouvé qui a vraiment rencontré mon problème..
    en fait le dispatch ne se fait jamais(meme quand j'ai essayé de overrider des méthodes de movieClip comme onPress et j'ai dispatché mes events form.. ça n'a pas marché..) la déclaration des events au début de la classe, et le component definition et l'insertion de UIObject et UIComponent movieclips.. etc sont tous fait mais en vain..)
    je sait qu'il y'a un gros truc prét à porter dedans.. lequel je ne sais encore pas..
    le saviez vous

Discussions similaires

  1. Flash as2 components treeCellRenderer
    Par abenhass dans le forum Flash
    Réponses: 5
    Dernier message: 17/06/2006, 11h40
  2. [FLASH MX2004] [components] checkbox label autosize
    Par abenhass dans le forum Flash
    Réponses: 3
    Dernier message: 07/03/2006, 11h11
  3. Réponses: 6
    Dernier message: 13/02/2005, 00h40
  4. [FLASH MX2004] [AS2] EventDispatcher
    Par bolo dans le forum ActionScript 1 & ActionScript 2
    Réponses: 13
    Dernier message: 29/12/2004, 13h59
  5. [FLASH MX 2004]Scrollpane component
    Par cavo789 dans le forum Flash
    Réponses: 10
    Dernier message: 23/06/2004, 11h18

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo