A Flash Developer Resource Site

Page 2 of 2 FirstFirst 12
Results 21 to 22 of 22

Thread: how spinning 3d object --> on mouse over same 3d wireframe object

  1. #21
    Junior Member
    Join Date
    Dec 2000
    Posts
    5
    I've downloaded your .fla and I'm still confused on how to set up the button. I have both movie clips, but cannot get them to sync up with one another. I see that you only have an action in the "hit" part of the button. I'm not seeing were the change is taking place. Maybe I just need a little more of a briefing on flash buttons. Any help would be great!

    Thanks,
    -Joe

    Originally posted by RUSHVision
    So to get that to work, you are going to want to set it up a bit differently. You want three items on your main timeline.
    1) a movie clip with the shaded object
    2) a movie clip with the outlined object
    3) a button that controls the action

    You can see the effect by mousing over any part of the movie. You will need to give your movie clips instance names then you can target them and set their alpha or visibility with various mouse events. You want to be careful with this technique though, because even though the wireframe version is not visible, it is still there and taking up processor power.

    I added the line so you could see that it does not jump back to the first frame on mouseover. The button simply has a shape the size of the stage in the hit frame and that is all.

  2. #22
    Senior Member RUSHVision's Avatar
    Join Date
    Dec 2000
    Location
    Pacific Northwest
    Posts
    5,441
    Hi there ~

    So first of all, syncing up your animations should be the least of your worries. Both of the animations in my example are the exact same thing...I just used two different settings when I exported it from Swift3D. I did the filled one and then changed the settings to get an outline and immediately exported that one. So, these should be exactly the same except for the fact that one is outlined and one is filled. These were each imported into their own movie clip, dragged onto the stage, then centered so they would both occupy the same space. Then I selected them both and moved them into their final position. The shadow is a copy of the gear clip with the gradient with the brightness all the way down and the alpha set to 10%.

    There are three frames on the main timeline. The first frame has only the gradient background and some text that says "Loading"...poor man's preloader, if you will. I didn't put too much time into it. In the second frame there is a frame action that sets the visibility of the outline gear clip to "0", or not visible. So now you have three movie clips on the stage...the gradient gear clip, the outline gear clip, and the copy of the gradient gear clip that acts as a shadow and all of these should be moving in exact sync with each other. The shadow clip is never targeted by any actions...it just goes 'round and 'round no matter which other clip is visible. The buttons only target the gradient gear clip and the outline gear clip.

    Code:
    on (rollOver, dragOver) {
        setProperty ("_root.gearOutline", _visible, "1");
        setProperty ("_root.gearArea", _alpha, "10");
    }
    on (releaseOutside, rollOut, dragOut) {
        setProperty ("_root.gearArea", _alpha, "100");
        setProperty ("_root.gearOutline", _visible, "0");
    }
    Above is the code that is placed on the invisible button that covers the entire movie. As you can see, two things happen both on rollOver and on rollOut. When you roll over the button, the outline gear clip's visibility is set to "1", or visible. The gradient gear clip's alpha is also set to 10%. I just thought this looked a bit better that having it go completely invisible.

    When you roll off the button, the outline gear clip's visibility is set back to "0" and the gradient clip's alpha is set back to 100%.

    As for the action in the hit frame of the button...there aren't actually any actions within a button itself, but yes the only thing in the button is a shape that covers the whole stage and this shape resides in the hit frame of the button. That's why when you turn the visibility of that layer back on (by hitting the eye next to the padlock by the layer name) it shows sort of a transparent blue shape. This is how Flash shows buttons that don't contain any graphics in the first frame of the button timeline. Aside from the one frame action that initially sets the visibility of the outline gear clip to "0", all of the actions are on the button instance that sits on the main timeline. The actions for this button are shown above as previously described.

    Let me know if you have any more questions.

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