dcsimg
A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: How to create buttons that control a MC that also move with the MC

  1. #1
    Junior Member
    Join Date
    Nov 2011
    Posts
    4

    How to create buttons that control a MC that also move with the MC

    I'm aiming to create a website that works just like this one;
    http://www.konrad-schmidt.com/#/home

    I want similar features, ie; rotating and expanding text controlled by mouse events and drop downs.

    I'm not concerned about the drop downs currently, but for all I can think of right now, I am trying to figure out the best way to complete this task, and the code (AS3) that would be needed.

    I've come up with a few thoughts (forgive me as I'm only moderate at Flash- can code, remember most of it, understand it, but can't always come up with the solution off the top of my head);

    Creating a parent movie clip child button (but I want many buttons)
    Creating Movie clip buttons inside the movie clip (honestly it doesn't matter so much at this point whether its a movie clip or button)

    Tl : dr
    Trying to figure out how to do this:
    http://www.konrad-schmidt.com/#/home

  2. #2
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    WARNING: some pictures on that site are not work safe. Too bad I visited it at work.

    There's a lot more there than getting a button/clip to control actions in its parent. If you are having trouble at that stage, then I would think you'd need some fairly intensive hand-holding to get to your goal.

    That said, you're right that it does not matter whether your button is a Button or MovieClip or Sprite or whatever. Make it a child of the instance it triggers changes in, and it'll move along with that parent.

    In looking around, you will probably find things that say that you should use MovieClip(parent).somethingorother().
    Don't do that. It's not great design to have children bossing their parents around. Instead, have the parent add an event listener which reacts to clicking on the button.

  3. #3
    Junior Member
    Join Date
    Nov 2011
    Posts
    4
    My apologies 5tonsofflax, I should've noted that his photography can get risque.

    On another note, I feel I just need to be sent in a direction, then I usually figure it out from there.

    I feel it's a larger containing movieclip holding many smaller ones that react, but I need to figure out the best way to make this happen, and have the 'button' follow with each clip.

    It still all sums up to how to get the inner 'buttons' to control all of it, and each contained movie clip to play as well.

    I figured I'd ask if just to get some direction, but this may be one of those things best asked and figured out in person.

  4. #4
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    Looks to me like there's an interface and a content area. The interface is that jumble of text, which acts as a menu and framing decoration. The words in the interface will, when clicked, activate functions which
    • tween the interface to a new state (rotation, position, relative sizes, etc)
    • tween the content area to the correct place
    • load or show the correct content.

  5. #5
    Junior Member
    Join Date
    Nov 2011
    Posts
    4
    So, pretty much I add event listeners to the main containing movie clip, that listen for when buttons inside are clicked, that will rotate the containing movie clip, and play the pressed movie clip....
    Are my thoughts on the right track?

  6. #6
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    Play? As in frames? There's no need for any of these to be actual MovieClips instead of Sprites. Use a tweening engine to programmatically accomplish your animations rather than a series of frames.

  7. #7
    Junior Member
    Join Date
    Nov 2011
    Posts
    4
    Well, play the inner movieclip (such as the Analog button, etc- would then 'play' it's slide out or drop drown and stay unless clicked upon when an image would enlarge)

    I can see Sprites being easier, but I havent worked with them tons, so it'll be a learning curve. But one I could definitely use.

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