A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Can I do this?

  1. #1
    Member
    Join Date
    Jan 2002
    Posts
    54
    I ve created 3 draggable buttons (name of "r, g, b" because RGB).

    Then there is a background (farbe), which should change the color when you drag the buttons.

    Here is the script of the background:
    color = new Color(farbe);
    Transform = new Object();
    Transform.ra = 50;
    Transform.rb = getProperty ( _root.r, _y );
    Transform.ga = 40;
    Transform.gb = getProperty ( _root.g, _y );
    Transform.ba = 12;
    Transform.bb = getProperty ( _root.b, _y );
    Transform.aa = 100;
    Transform.ab = 255;
    color.setTransform(Transform);

    The script of the buttons is a that of a standart draggable object.

    Now when I run the movie the background gets a certain color, but it doesnt react on the buttons at all!

    Now I m not shure what is wrong but I think it is about this "getProperty" parts.

  2. #2
    Member
    Join Date
    Dec 2001
    Posts
    73
    Think u should make a loop to acchive the result, i.e make anotherer frame with a "gotoAndPlay(1)"

  3. #3
    Member
    Join Date
    Jan 2002
    Posts
    54
    it is already looped but the background still doesnt change its color!

  4. #4
    Member
    Join Date
    Dec 2001
    Posts
    73
    can u post the full code with its frames

    frame1: //code
    frame2: //code

  5. #5
    Member
    Join Date
    Jan 2002
    Posts
    54
    I ve posted the full file it is a bit complicated, hope you can use it!

    Szene 1
    R, (Times New Roman, 12 Pkt.)
    G, (Times New Roman, 12 Pkt.)
    B, (Times New Roman, 12 Pkt.)
    background, (farbe)

    actions for frame 1
    color = new Color(farbe);
    Transform = new Object();
    Transform.ra = getProperty(r, _y);
    Transform.rb = 0;
    Transform.ga = getProperty(g, _y);
    Transform.gb = 0;
    Transform.ba = getProperty(b, _y);
    Transform.bb = 0;
    Transform.aa = 100;
    Transform.ab = 255;
    color.setTransform(Transform);

    dragging, (r)
    actions for dragging
    onClipEvent (load) {
    top = _y;
    left = _x;
    right = _x;
    bottom = _y + 100;
    ;
    }
    onClipEvent (enterFrame) {
    if (dragging == true) {
    a = 177 - _y;
    }
    }

    dragging, (g)
    actions for dragging
    onClipEvent (load) {
    top = _y;
    left = _x;
    right = _x;
    bottom = _y + 100;
    ;
    }
    onClipEvent (enterFrame) {
    if (dragging == true) {
    b = 177 - _y;
    }
    }

    dragging, (b)
    actions for dragging
    onClipEvent (load) {
    top = _y;
    left = _x;
    right = _x;
    bottom = _y + 100;
    ;
    }
    onClipEvent (enterFrame) {
    if (dragging == true) {
    c = 177 - _y;
    }
    }
    actions for frame 2
    gotoAndPlay (1);
    dragging, (r)
    actions for dragging
    onClipEvent (load) {
    top = _y;
    left = _x;
    right = _x;
    bottom = _y + 100;
    ;
    }
    onClipEvent (enterFrame) {
    if (dragging == true) {
    a = 177 - _y;
    }
    }
    Schieben, (g)
    actions for dragging
    onClipEvent (load) {
    top = _y;
    left = _x;
    right = _x;
    bottom = _y + 100;
    ;
    }
    onClipEvent (enterFrame) {
    if (dragging == true) {
    b = 177 - _y;
    }
    }
    Schieben, (b)
    actions for dragging
    onClipEvent (load) {
    top = _y;
    left = _x;
    right = _x;
    bottom = _y + 100;
    ;
    }
    onClipEvent (enterFrame) {
    if (dragging == true) {
    c = 177 - _y;
    }
    }
    Symboldefinition(en)
    Hintergrund
    Schieben
    Schieberegler
    Aktionen für Schieberegler
    on (press) {
    startDrag ("", false, left, top, right, bottom);
    dragging = true;
    }
    on (release) {
    stopDrag ();
    dragging = false;
    }
    Schieberegler

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center