flash Q

  • Started
  • Last post
  • 10 Responses
  • Kiko

    http://www.fusedigital.com/

    in the flash used on this page, there is a hot sopt in the image, when you roll out of the hot sopt it goes to the next image.
    Is it possible to make the hotspot animated so that you ahve to roll out of the flash application before it returns?
    By this I mean , I am making the same thing and I have text in there and I think that some people will use their mouse to read the text.

    Is this getting through to anyone?

  • Luckypp0

    Kind of making sense. I think you are asking if a hotspot can be animated, and the answer is yes. All you need to do is embed your button or movie clip in a movie clip and animate it, or just animate it on the timeline. You can turn play on and off with the rollover.

  • Bottlerocket0

    The issue will be when you rollout of the movie onto the rest of the page. You need to make the 'hit area' smaller than the movie borders so you can acutally rollout of something..but even if you do that and you move too quickly, than the rollout will not register.

  • Luckypp0

    You can also have the hit size resize on rollover, and rollout.

  • Kiko0

    I tried to animate the hotspot but I dont seem to get the results you mentioned.

  • davi-t0

    resizing the hot spot isn't going to work since u have to deal with the 'layering' of the button hit areas.
    The easiest workaround for this (not the best solution), is to create another big ass invisible button on top of ALL of the other buttons that covers all of the other buttons hit areas. Since this 'big ass button' is on top of the other buttons, it will override all of the other buttons. But u also want to make sure that all of ur buttons (including the new big ass button) shouldn't reach to the far ends of the stage...so u can have 'somewhat' of a rollout trigger. So when u rollover one of the image buttons, it will activate the big ass button, and the big ass button will take care of all of the rollout shit.
    For example:
    // code for an image button.
    image_btn1.onRollOver=function...
    // doExpand() would be however u r triggering that MC to expand.

    //Code for big ass button.
    bigAss_btn.onRollOut=function...

    // currentImage.doSlideBack() would be whatever current image slide is expanded. doSlideBack() would be however you are making the expanded state retract.

    Obviously, you have to tweak this code and replace the functions with your own code but that 'does' work. Basically, what's happening with ur current hit areas are that the other hit areas are on a layer above the current expanding hit area, so u WILL still trigger those hit spots. Another solution would be to use swapDepths() but I'm not sure how you feel with using that. An even better solution would be to create an array of all of the buttons, and when you rollover one, it disables the rest of the buttons temporarily (btnArray.enabled=false;)...roll... out will reset (ie. enable) all of the buttons again. Hope that helps.
    -davi-t

  • Kiko0

    wow!!

    thanx for taking the time out to answer that for me, you are right the animated hotsop does not work. let me give what you are suggesting a go.

    thanx again !!

  • Luckypp0

    Well perhaps just having the hotspot resize isn't going to work, but with turning on and off hit states, it can work.

  • Kiko0

    how do I turnon and off hit states?

  • davi-t0

    You have to give the buttons an instance name first. Then use the property 'enabled' to enable/disable the button (the same as turning off hit state). The 'enabled' property has a boolean value (meaning, its either true or false).
    So lets say button 1 is called "btn1'. You would write:

    btn1.enabled = true;
    //--> This makes the button active

    btn1.enabled = false;
    //--> This makes the button inactive (ie. code doesn't work, no hand cursor on rollover etc).

    -davi-t

  • davi-t0

    Also, from my understanding of ur AS experience you prolly don't know how to use Arrays, loops or functions. So, here's a cheezy way how to disable all of the other buttons when u rollover one button:

    btn1.onRollOver=function(){
    button2.enabled=false;
    button3.enabled=false;
    button4.enabled=false;
    this.enabled=true;
    //--> Add code to trigger rollover animation here.
    }

    Repeat for the rest of the buttons, swap the btn instances that should be disabled accordingly. The big ass button post I told u earlier is actually a much easier way to accomplish this.

    Again, this is not how you 'should' do it, but its a way if u do not understand arrays. Arrays basically would take away the tedious process of hard coding EVERY button like how I just showed you. You should read up on Functions, Variables, loops, and arrays...will make ur life mucho easier.