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 Pascal Discussion :

Nouvelle version 12.06.25 disponible !


Sujet :

Flash Pascal

  1. #1
    Expert éminent sénior
    Avatar de Paul TOTH
    Homme Profil pro
    Freelance
    Inscrit en
    Novembre 2002
    Messages
    8 964
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 54
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Freelance
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Novembre 2002
    Messages : 8 964
    Points : 28 430
    Points
    28 430
    Par défaut Nouvelle version 12.06.25 disponible !
    - Corrections de différents bug dans la gestion de unités (collision de nom entre les unités).
    - Possibilité de qualifier un élément avec le nom d'unité (Flash8.MovieClip).
    - Meilleurs gestion de la mémoire (fuites).
    - Ajout du mot clé external sur les variables globales externes (_root: MovieClip external.
    - Les membres numériques des classes sont automatiquement initialisés à 0.
    - Ajout d'une option d'obfuscation du code.
    - Mise à jour du site avec de nouveaux exemples.

    Le source du défi #1 et de la texture procédurale "bois" sont dans les exemples de cette nouvelle version.

    http://flashpascal.execute.re
    Developpez.com: Mes articles, forum FlashPascal
    Entreprise: Execute SARL
    Le Store Excute Store

  2. #2
    Membre chevronné
    Avatar de Archimède
    Homme Profil pro
    Enseignant
    Inscrit en
    Avril 2005
    Messages
    1 644
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 58
    Localisation : France, Charente Maritime (Poitou Charente)

    Informations professionnelles :
    Activité : Enseignant
    Secteur : Enseignement

    Informations forums :
    Inscription : Avril 2005
    Messages : 1 644
    Points : 1 975
    Points
    1 975
    Par défaut


    magnifique...

  3. #3
    Membre chevronné
    Avatar de Archimède
    Homme Profil pro
    Enseignant
    Inscrit en
    Avril 2005
    Messages
    1 644
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 58
    Localisation : France, Charente Maritime (Poitou Charente)

    Informations professionnelles :
    Activité : Enseignant
    Secteur : Enseignement

    Informations forums :
    Inscription : Avril 2005
    Messages : 1 644
    Points : 1 975
    Points
    1 975
    Par défaut
    Possibilité de qualifier un élément avec le nom d'unité

    ça, c'est une belle avancée ...ça manquait

    Pour étoffer le forum, il faudrait maintenant développer quelques unités indispensables gérant la création de contrôles dynamiquement :
    button, trackbar, combobox (au moins le minimum)
    En dérivant de movieclip...Je pense que c'est ça qui pourrait faire venir davantage de personnes sur le forum.
    Tu essayes de faire une animation mais tu n'as d'outils de contrôle à manipuler pour agir sur celle-ci. Il faut se les faire... ça peut en décourager certains, je pense.
    Le résultat est déjà exceptionnel, dommage que tout le monde ne s'en rend pas compte...

  4. #4
    Expert éminent sénior
    Avatar de Paul TOTH
    Homme Profil pro
    Freelance
    Inscrit en
    Novembre 2002
    Messages
    8 964
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 54
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Freelance
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Novembre 2002
    Messages : 8 964
    Points : 28 430
    Points
    28 430
    Par défaut
    Citation Envoyé par Archimède Voir le message

    ça, c'est une belle avancée ...ça manquait

    Pour étoffer le forum, il faudrait maintenant développer quelques unités indispensables gérant la création de contrôles dynamiquement :
    button, trackbar, combobox (au moins le minimum)
    En dérivant de movieclip...Je pense que c'est ça qui pourrait faire venir davantage de personnes sur le forum.
    Tu essayes de faire une animation mais tu n'as d'outils de contrôle à manipuler pour agir sur celle-ci. Il faut se les faire... ça peut en décourager certains, je pense.
    Le résultat est déjà exceptionnel, dommage que tout le monde ne s'en rend pas compte...
    je pense qu'il y a moyen d'avoir des choses sympas en effet

    Nom : Presse-papiers-10.jpg
Affichages : 166
Taille : 17,2 Ko

    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
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
     
    program Project1;
     
    {$FRAME_WIDTH 640}
    {$FRAME_HEIGHT 480}
     
    uses
      Flash8;
     
    var
      Arial12   : TextFormat;
      ActiveItem: TextFormat;
     
    type
      TListBox = class(MovieClip)
        FWidth : Integer;
        FHeight: Integer;
        FItems : array of TextField;
        FCount : Integer;
        FIndex : Integer;
        FFocus : Integer;
        constructor Create(Parent: MovieClip; x, y, w, h: Integer);
        procedure AddItem(Value: string);
        procedure SetItemIndex(Value: Integer);
        procedure Show;
        function MouseItem: Integer;
        procedure onMouseMove;
        procedure onMouseDown;
        procedure redraw();
      end;
     
      TComboBox = class(MovieClip)
        FText : TextField;
        FList : TListBox;
        FOver: Boolean;
        constructor Create(Parent: MovieClip; x, y, w, h: Integer);
        procedure redraw();
        procedure onRollOver;
        procedure onRollOut;
        procedure onMouseDown;
        procedure onRelease;
        procedure onReleaseOutside;
        procedure onPress;
        procedure AddItem(Value: string);
        procedure SetItemIndex(Value: Integer);
      end;
     
    constructor TListBox.Create(Parent: MovieClip; x, y, w, h: Integer);
    begin
      inherited Create(Parent, '', Parent.getNextHighestDepth);
      _x := x;
      _y := y;
      FWidth := w;
      FHeight := h;
      FIndex := -1;
      redraw();
    end;
     
    procedure TListBox.redraw();
    begin
      clear;
      lineStyle(1, 0);
      beginFill(clWhite);
      moveTo(0, 0);
      lineTo(FWidth, 0);
      lineTo(FWidth, FCount * FHeight);
      lineTo(0, FCount * FHeight);
      lineTo(0, 0);
    end;
     
    procedure TListBox.AddItem(Value: string);
    var
      Item: TextField;
    begin
      Item := TextField.Create(Self, '', FCount, 1, FHeight * FCount, FWidth - 1, FHeight);
      Item.setNewTextFormat(Arial12);
      Item.backgroundColor := $3399ff;
      Item.Text := Value;
      FItems[FCount] := Item;
      Inc(FCount);
      redraw();
    end;
     
    procedure TListBox.SetItemIndex(Value: Integer);
    begin
      if FIndex <> Value then
      begin
        if FIndex >= 0 then
          with FItems[FIndex] do
          begin
            setTextFormat(0, $7FFFFFF, Arial12);
            background := False;
          end;
        FIndex := Value;
        FFocus := Value;
        if FIndex >= 0 then
          with FItems[FIndex] do
          begin
            setTextFormat(0, $7FFFFFF, ActiveItem);
            background := True;
          end;
      end;
    end;
     
    procedure TListBox.Show;
    begin
      if FFocus <> FIndex then
      begin
        if FFocus >= 0 then
          with FItems[FFocus] do
          begin
            setTextFormat(0, $7FFFFFF, Arial12);
            background := False;
          end;
        FFocus := FIndex;
        if FIndex > 0 then
          with FItems[FIndex] do
          begin
            setTextFormat(0, $7FFFFFF, ActiveItem);
            background := True;
          end;
      end;
      _visible := True;
    end;
     
    function TListBox.MouseItem: Integer;
    begin
      if (_xmouse < 0) or (_ymouse < 0) or (_xmouse > FWidth) or (_ymouse > FCount * FHeight) then
        Result := -1
      else
        Result := Trunc(_ymouse / FHeight);
    end;
     
    procedure TListBox.onMouseMove;
    var
      i: Integer;
    begin
      i := MouseItem;
      if i < 0 then
        Exit;
      if i <> FFocus then
      begin
        if FFocus >= 0 then
          with FItems[FFocus] do
          begin
            setTextFormat(0, $7FFFFFF, Arial12);
            background := False;
          end;
        FFocus := i;
        if FFocus >= 0 then
          with FItems[FFocus] do
          begin
            setTextFormat(0, $7FFFFFF, ActiveItem);
            background := True;
          end;
      end;
    end;
     
    procedure TListBox.onMouseDown;
    var
      i: Integer;
    begin
      i := MouseItem;
      if i >= 0 then
        TComboBox(_parent).SetItemIndex(i); // quick hack en attendant mieux
    end;
     
    constructor TComboBox.Create(Parent: MovieClip; x, y, w, h: Integer);
    begin
      inherited Create(Parent, '', Parent.getNextHighestDepth);
      FText := TextField.Create(Self, 'Text', 1, 1, 1, w - 14, h - 2);
      FText.selectable := False;
      FText.setNewTextFormat(Arial12);
      FText.Text := 'ComboBox1';
      FList := TListBox.Create(Self, 0, h, w, h - 2);
      FList._visible := False;
      FOver := False;
      _x := x;
      _y := y;
      redraw();
    end;
     
    procedure TComboBox.redraw();
    var
      w, h, t: Number;
      matrix: Flash8.Matrix;
    begin
      w := FText._width + 15;
      h := FText._height + 2;
      clear();
      lineStyle(1, $707070);
      matrix := Flash8.Matrix.Create();
      matrix.createGradientBox(w, h, Math.PI/2, 0, 0);
      if FList._visible then
        beginGradientFill('linear',
          [$deedf6,$c4e5f6,$98d1ef,$66afd7],
          [100,100,100,100],
          [0,127,128,255],
          matrix
        )
      else
      if FOver then
        beginGradientFill('linear',
          [$eaf6f2,$d9f0fc,$bef6fd,$a7d9f5],
          [100,100,100,100],
          [0,127,128,255],
          matrix
        )
      else
        beginGradientFill('linear',
          [$f2f2f2,$ebebeb,$dddddd,$cfcfcf],
          [100,100,100,100],
          [0,127,128,255],
          matrix
        );
      moveTo(0, 2);
      lineTo(2, 0);
      lineTo(w - 2, 0);
      lineTo(w, 2);
      lineTo(w, h - 2);
      lineTo(w - 2, h);
      lineTo(2, h);
      lineTo(0, h - 2);
      lineTo(0, 2);
      endFill;
      lineStyle(1, 0);
      beginFill(0);
      t := (h - 4) / 2;
      moveTo(w - 12, t);
      lineTo(w -  6, t);
      lineTo(w -  9, t + 4);
    end;
     
    procedure TComboBox.AddItem(Value: string);
    begin
      FList.AddItem(Value);
    end;
     
    procedure TComboBox.SetItemIndex(Value: Integer);
    begin
      FList.SetItemIndex(Value);
      FText.Text := FList.FItems[Value].Text;
      FOver := False; // ??
      redraw();
    end;
     
    procedure TComboBox.onRollOver;
    begin
      FOver := True;
      redraw();
    end;
     
    procedure TComboBox.onRollOut;
    begin
      FOver := False;
      redraw();
    end;
     
    procedure TComboBox.onMouseDown;
    begin
      if FList._visible and (FOver = False) then
      begin
         FList._visible := False;
         redraw();
      end;
    end;
     
    procedure TComboBox.onRelease;
    begin
      if _ymouse > FText._height then
      begin
        SetItemIndex(FList.FFocus);
        FList._visible := False;
        redraw();
      end;
    end;
     
    procedure TComboBox.onReleaseOutside;
    begin
      FList._visible := False;
      FOver := False; // ??
      redraw();
    end;
     
    procedure TComboBox.onPress;
    begin
      if FList._visible then
        FList._visible := False
      else
        FList.Show;
      redraw();
    end;
     
    begin
      Arial12 := TextFormat.Create('Arial', 12, 0);
      ActiveItem := TextFormat.Create();
      ActiveItem.Color := clWhite;
      with TComboBox.Create(_root, 10, 10, 250, 21) do
      begin
        AddItem("Arrière-plans du Bureau Windows");
        AddItem("Bibliothèque d'images");
        AddItem('Photos ayant le meilleur classement');
        AddItem('Couleurs unies');
        AddItem('Fond Ecran');
        AddItem("Téléchargements");
        SetItemIndex(4);
      end;
    end.
    par contre il faut que j'enrichisse le langage car pour l'instant seules les classes externes peuvent déclarer des propriétés il faut que j'ajoute aussi les portés (private, public...)
    Developpez.com: Mes articles, forum FlashPascal
    Entreprise: Execute SARL
    Le Store Excute Store

  5. #5
    Membre chevronné
    Avatar de Archimède
    Homme Profil pro
    Enseignant
    Inscrit en
    Avril 2005
    Messages
    1 644
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 58
    Localisation : France, Charente Maritime (Poitou Charente)

    Informations professionnelles :
    Activité : Enseignant
    Secteur : Enseignement

    Informations forums :
    Inscription : Avril 2005
    Messages : 1 644
    Points : 1 975
    Points
    1 975
    Par défaut
    Ah, la classe (sans jeu de mots )
    Je te fais confiance pour régler tes problèmes d'encapsulation et le tour sera joué.

    Joli travail !

    bonne soirée

  6. #6
    Membre chevronné
    Avatar de Archimède
    Homme Profil pro
    Enseignant
    Inscrit en
    Avril 2005
    Messages
    1 644
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 58
    Localisation : France, Charente Maritime (Poitou Charente)

    Informations professionnelles :
    Activité : Enseignant
    Secteur : Enseignement

    Informations forums :
    Inscription : Avril 2005
    Messages : 1 644
    Points : 1 975
    Points
    1 975
    Par défaut
    Voilà, j'ai essayé de mettre en situation ton combobox...
    J'ai trouvé ça en modifiant un peu...

    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
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
     
    unit UCombobox;
     
    interface
    uses
      Flash8;
     
    var
      Arial12   : TextFormat;
      ActiveItem: TextFormat;
     
    type
      TListBox = class(MovieClip)
        FWidth : Integer;
        FHeight: Integer;
        FItems : array of TextField;
        FCount : Integer;
        FIndex : Integer;
        FFocus : Integer;
        constructor Create(Parent: MovieClip; x, y, w, h: Integer);
        procedure AddItem(Value: string);
        procedure SetItemIndex(Value: Integer);
        procedure Show;
        function MouseItem: Integer;
        procedure onMouseMove;
        procedure onMouseDown;
        procedure redraw();
      end;
     
      TComboBox = class(MovieClip)
        Itemindex:number;
        FText : TextField;
        FList : TListBox;
        FOver: Boolean;
        constructor Create(Parent: MovieClip; x, y, w, h: Integer);
        procedure redraw();
        procedure onRollOver;
        procedure onRollOut;
        procedure onMouseDown;
        procedure onRelease;
        procedure onReleaseOutside;
        procedure onPress;
        procedure AddItem(Value: string);
        procedure SetItemIndex(Value: Integer);
      end;
     
    implementation
     
    constructor TListBox.Create(Parent: MovieClip; x, y, w, h: Integer);
    begin
      inherited Create(Parent, '', Parent.getNextHighestDepth);
      _x := x;
      _y := y;
      FWidth := w;
      FHeight := h;
      FIndex := -1;
      redraw();
    end;
     
    procedure TListBox.redraw();
    begin
      clear;
      lineStyle(1, 0);
      beginFill(clWhite);
      moveTo(0, 0);
      lineTo(FWidth, 0);
      lineTo(FWidth, FCount * FHeight);
      lineTo(0, FCount * FHeight);
      lineTo(0, 0);
    end;
     
    procedure TListBox.AddItem(Value: string);
    var
      Item: TextField;
    begin
      Item := TextField.Create(Self, '', FCount, 1, FHeight * FCount, FWidth - 1, FHeight);
      Item.setNewTextFormat(Arial12);
      Item.backgroundColor := $3399ff;
      Item.Text := Value;
      FItems[FCount] := Item;
      Inc(FCount);
      redraw();
    end;
     
    procedure TListBox.SetItemIndex(Value: Integer);
    begin
      if FIndex <> Value then
      begin
        if FIndex >= 0 then
          with FItems[FIndex] do
          begin
            setTextFormat(0, $7FFFFFF, Arial12);
            background := False;
          end;
        FIndex := Value;
        FFocus := Value;
        if FIndex >= 0 then
          with FItems[FIndex] do
          begin
            setTextFormat(0, $7FFFFFF, ActiveItem);
            background := True;
          end;
      end;
    end;
     
    procedure TListBox.Show;
    begin
      if FFocus <> FIndex then
      begin
        if FFocus >= 0 then
          with FItems[FFocus] do
          begin
            setTextFormat(0, $7FFFFFF, Arial12);
            background := False;
          end;
        FFocus := FIndex;
        if FIndex > 0 then
          with FItems[FIndex] do
          begin
            setTextFormat(0, $7FFFFFF, ActiveItem);
            background := True;
          end;
      end;
      _visible := True;
    end;
     
    function TListBox.MouseItem: Integer;
    begin
      if (_xmouse < 0) or (_ymouse < 0) or (_xmouse > FWidth) or (_ymouse > FCount * FHeight) then
        Result := -1
      else
        Result := Trunc(_ymouse / FHeight);
    end;
     
    procedure TListBox.onMouseMove;
    var
      i: Integer;
    begin
      i := MouseItem;
      if i < 0 then
        Exit;
      if i <> FFocus then
      begin
        if FFocus >= 0 then
          with FItems[FFocus] do
          begin
            setTextFormat(0, $7FFFFFF, Arial12);
            background := False;
          end;
        FFocus := i;
        if FFocus >= 0 then
          with FItems[FFocus] do
          begin
            setTextFormat(0, $7FFFFFF, ActiveItem);
            background := True;
          end;
      end;
    end;
     
    procedure TListBox.onMouseDown;
    var
      i: Integer;
    begin
      i := MouseItem;
      if i >= 0 then
      begin
        TComboBox(_parent).SetItemIndex(i); // quick hack en attendant mieux
        TComboBox(_parent).Itemindex:=i;
      end;
    end;
     
    constructor TComboBox.Create(Parent: MovieClip; x, y, w, h: Integer);
    begin
      inherited Create(Parent, '', Parent.getNextHighestDepth);
      Arial12 := TextFormat.Create('Arial', 12, 0);
      ActiveItem := TextFormat.Create();
      ActiveItem.Color := clWhite;
      FText := TextField.Create(Self, 'Text', 1, 1, 1, w - 14, h - 2);
      FText.selectable := False;
      FText.setNewTextFormat(Arial12);
      FText.Text := 'ComboBox1';
      FList := TListBox.Create(Self, 0, h, w, h - 2);
      FList._visible := False;
      FOver := False;
      _x := x;
      _y := y;
      redraw();
    end;
     
    procedure TComboBox.redraw();
    var
      w, h, t: Number;
      matrix: Flash8.Matrix;
    begin
      w := FText._width + 15;
      h := FText._height + 2;
      clear();
      lineStyle(1, $707070);
      matrix := Flash8.Matrix.Create();
      matrix.createGradientBox(w, h, Math.PI/2, 0, 0);
      if FList._visible then
        beginGradientFill('linear',
          [$deedf6,$c4e5f6,$98d1ef,$66afd7],
          [100,100,100,100],
          [0,127,128,255],
          matrix
        )
      else
      if FOver then
        beginGradientFill('linear',
          [$eaf6f2,$d9f0fc,$bef6fd,$a7d9f5],
          [100,100,100,100],
          [0,127,128,255],
          matrix
        )
      else
        beginGradientFill('linear',
          [$f2f2f2,$ebebeb,$dddddd,$cfcfcf],
          [100,100,100,100],
          [0,127,128,255],
          matrix
        );
      moveTo(0, 2);
      lineTo(2, 0);
      lineTo(w - 2, 0);
      lineTo(w, 2);
      lineTo(w, h - 2);
      lineTo(w - 2, h);
      lineTo(2, h);
      lineTo(0, h - 2);
      lineTo(0, 2);
      endFill;
      lineStyle(1, 0);
      beginFill(0);
      t := (h - 4) / 2;
      moveTo(w - 12, t);
      lineTo(w -  6, t);
      lineTo(w -  9, t + 4);
    end;
     
    procedure TComboBox.AddItem(Value: string);
    begin
      FList.AddItem(Value);
    end;
     
    procedure TComboBox.SetItemIndex(Value: Integer);
    begin
      FList.SetItemIndex(Value);
      itemindex:=value;
      FText.Text := FList.FItems[Value].Text;
      FOver := False; // ??
      redraw();
    end;
     
    procedure TComboBox.onRollOver;
    begin
      FOver := True;
      redraw();
    end;
     
    procedure TComboBox.onRollOut;
    begin
      FOver := False;
      redraw();
    end;
     
    procedure TComboBox.onMouseDown;
    begin
      if FList._visible and (FOver = False) then
      begin
         FList._visible := False;
         redraw();
      end;
    end;
     
    procedure TComboBox.onRelease;
    begin
      if _ymouse > FText._height then
      begin
        SetItemIndex(FList.FFocus);
        FList._visible := False;
        redraw();
      end;
    end;
     
    procedure TComboBox.onReleaseOutside;
    begin
      FList._visible := False;
      FOver := False; // ??
      redraw();
    end;
     
    procedure TComboBox.onPress;
    begin
      if FList._visible then
        FList._visible := False
      else
        FList.Show;
      redraw();
    end;
     
     
    end.
    le programme :

    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
     
    program Project1;
     
    {$FRAME_WIDTH 1000}
    {$FRAME_HEIGHT 500}
    {$FRAME_RATE 12}
    {$BACKGROUND $FFFFFF}
     
    uses
      Flash8,UCombobox;
     
      type
       Essai=class(movieClip)
        combo:TCombobox;
        Constructor Create;
        Procedure onEnterFrame;
       end;
     
     
    Constructor Essai.Create;
    begin
     inherited create(nil,'essai combo',0);
     combo:=Tcombobox.Create(self, 10, 10, 250, 21);
      with combo do
      begin
        AddItem("blabla 0");
        AddItem("Blabla1");
        AddItem('Blabla2');
        AddItem('mon action 3');
        AddItem('B.......');
        AddItem("RE b...........");
        SetItemIndex(0);
      end;
    end;
     
     
    procedure Essai.onEnterFrame;  //l'écouteur pour combo (je n'ai pas trouver autre chose)
    begin
      if combo.itemindex=3 then
       begin
           beginfill(clred);//l'action bidon
           moveto(500,30);
           lineto(600,30);
           lineto(600,400);
           lineto(500,400);
           lineto(500,50);
        end else clear;
    end;
     
     
    begin
      Essai.create;
    end.
    il faudrait un écouteur pour essai , ça marche avec onEnterFrame mais c'est un peu gênant vu que les animations sont conduites par cet événement.

  7. #7
    Membre chevronné
    Avatar de Archimède
    Homme Profil pro
    Enseignant
    Inscrit en
    Avril 2005
    Messages
    1 644
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 58
    Localisation : France, Charente Maritime (Poitou Charente)

    Informations professionnelles :
    Activité : Enseignant
    Secteur : Enseignement

    Informations forums :
    Inscription : Avril 2005
    Messages : 1 644
    Points : 1 975
    Points
    1 975
    Par défaut
    je viens de tester cette variante là qui fait intervenir le onEnterFrame du combo :
    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
     
    program Project1;
     
    {$FRAME_WIDTH 1000}
    {$FRAME_HEIGHT 500}
    {$FRAME_RATE 12}
    {$BACKGROUND $FFFFFF}
     
    uses
      Flash8,UCombobox;
     
      type
       Essai=class(movieClip)
        combo:TCombobox;
        Constructor Create;
        Procedure doEnterFramecombo;
       end;
     
     
    Constructor Essai.Create;
    begin
     inherited create(nil,'essai combo',0);
     combo:=Tcombobox.Create(self, 10, 10, 250, 21);
      with combo do
      begin
        AddItem("blabla 0");
        AddItem("Blabla1");
        AddItem('Blabla2');
        AddItem('mon action 3');
        AddItem('B.......');
        AddItem("RE b...........");
        SetItemIndex(0);
        onEnterframe:=doEnterFramecombo;
      end;
    end;
     
     
    procedure Essai.doEnterFramecombo; 
    begin
      if combo.itemindex=3 then
       begin
           beginfill(clred);//l'action bidon
           moveto(500,30);
           lineto(600,30);
           lineto(600,400);
           lineto(500,400);
           lineto(500,50);
        end else clear;
    end;
     
     
    begin
      Essai.create;
    end.

  8. #8
    Membre chevronné
    Avatar de Archimède
    Homme Profil pro
    Enseignant
    Inscrit en
    Avril 2005
    Messages
    1 644
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 58
    Localisation : France, Charente Maritime (Poitou Charente)

    Informations professionnelles :
    Activité : Enseignant
    Secteur : Enseignement

    Informations forums :
    Inscription : Avril 2005
    Messages : 1 644
    Points : 1 975
    Points
    1 975
    Par défaut
    Encore plus simple sur le onMouseUp :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
      onMouseUp:=doEnterFramecombo; // ou dochange

Discussions similaires

  1. [Flash Pascal] Nouvelle version 12.06.21 disponible !
    Par Paul TOTH dans le forum Flash Pascal
    Réponses: 13
    Dernier message: 15/08/2012, 20h52
  2. [Flash Pascal] Nouvelle version 12.07.07 disponible !
    Par Paul TOTH dans le forum Flash Pascal
    Réponses: 1
    Dernier message: 07/07/2012, 20h02
  3. [Flash Pascal] Nouvelle version 12.07.02 disponible !
    Par Paul TOTH dans le forum Flash Pascal
    Réponses: 11
    Dernier message: 04/07/2012, 11h37
  4. Nouvelle version de Rave Reports disponible
    Par Pedro dans le forum Outils
    Réponses: 1
    Dernier message: 02/04/2009, 10h38
  5. [Dojo] Nouvelle version 1.3 RC2 disponible
    Par emmanuel.remy dans le forum Bibliothèques & Frameworks
    Réponses: 1
    Dernier message: 30/03/2009, 09h27

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