Skip to main content
Inspiring
October 22, 2020
Answered

Button over state using camera in HTML5

  • October 22, 2020
  • 2 replies
  • 1635 views

Hi,

 

so I used the camera once many years ago and dont remember this problem. But now I have had to use the camera once again and noticed the Over state in a button doesnt show when published.

 

I did Google this and looked here in the forum but couldnt find similar thread (apologies if I missed it).

My take is that this is because when using the camera that Advanced Layers needs to be on to work (but when I used the camera years ago there was no Advanced Layers)? And this makes all layers behave like objects? 

 

Is there a way around this so I can show the Over state of a button in Advanced Layers mode or does the button need created as a movieclip, then use 'mouseover' code to show the button over state?

 

Thanks

 

Greg

    This topic has been closed for replies.
    Correct answer GoryGreg

    Thanks João!

     

    So Prashant got back to me and said they were able to reproduce the issue and logged it.

     

    He did say to wrap the button in a movie clip. This works and it is possibly (if it causes no other issues) a better and less time consuming solution than what I suggested in my last comment?

     

    Cheers

     

    Greg

    2 replies

    GoryGregAuthor
    Inspiring
    October 23, 2020

    So with the help of João and further testing we kind of think what causes the Over state not to work.

     

    Simply put if you have a timeline of 6 secs, for example, with the camera on then the button has to to span that 6 seconds too (not even a frame less) so when it reaches the this.stop() frame that the over state doesnt disappear.

     

    This is how I tested it...

     

    Firstly, I created a new html5. On the first frame I create a button- test it and the over state works (obviously advanced layers is on for all testing). Then I turn on camera- test it and it still works with everything on one frame.

     

    Next, I expand the timeline for six seconds and also the button spans for that full 6 seconds, with a this.stop() on the very last frame. I test it with camera on and off- the over state works as planned with it on or off.

     

    BUT then if you move the first keyframe of the button onto the second frame so it spans shorter than the 6 seconds with the camera on then the over state works UNTIL you reach the this.stop() frame and it goes off!?!

     

    Here is my test file...

    https://we.tl/t-vywu8kVUVC

     

    See how if you shorten the button span by even 1 frame it will go off from the button over state on the last frame ( this.stop() frame)!

     

    If I hide the button for full 6 seconds but make visible on the last this.stop frame then the over state works and maybe this is what I need to do to make it work for whenever I dont want/need a button to be seen.

     

    Hopefully this helps anybody or they can give a better explanation or work around?

    JoãoCésar17023019
    Community Expert
    October 26, 2020

    Excellent, Greg!

     

    Thanks a lot for the feedback.

     

    Hopefully the Animate team will see this problem and find a solution.

     

     

    Regards,

    JC

    GoryGregAuthorCorrect answer
    Inspiring
    October 26, 2020

    Thanks João!

     

    So Prashant got back to me and said they were able to reproduce the issue and logged it.

     

    He did say to wrap the button in a movie clip. This works and it is possibly (if it causes no other issues) a better and less time consuming solution than what I suggested in my last comment?

     

    Cheers

     

    Greg

    JoãoCésar17023019
    Community Expert
    October 22, 2020

    Hi, Greg!

     

    It seems to be working fine here in version 21.0.

     

    Maybe you're using a FLA generated with an older version of Animate and some incompatibility has been created.

     

    Are you able to copy all of your assets to a new FLA created in the most recent version?

     

    Please let us know.

     

    Regards,

    JC

    GoryGregAuthor
    Inspiring
    October 22, 2020

    Hi João! 🙂

     

    So this is Animate 2021 I just updated to see what it is like and thought I'd try the camera on this version (I usually do all my work on the more stable 2019 version and have it installed on this PC too). This is a new html5 file I created and no assets copied over, only an image that I dropped into the library.

     

    When I turn off Advanced Layers the button Over state works okay but obviously the camera doesnt. I also tried it in 2019 version and still the Over state for the button doesnt show.

     

    'Advanced Layers' is coming back to haunt me after all those times I asked people on here 'Have you turned off Advanced Layers?' ha ha!!!

     

    Cheers

     

    Greg

     

    GoryGregAuthor
    Inspiring
    October 22, 2020

    So I just reset preferences for 2021, uninstalled and reinstalled it then tried again from a brand new html5 file. The Over state in a button just wont work for me with Advanced Layers on (I switched it off to check and the Over state then works).