Quantcast
Channel: Adobe Community : All Content - Adobe Animate CC - General
Viewing all articles
Browse latest Browse all 13519

Bring to front for HTML5 Canvas

$
0
0

I am making a website in flash using the HTML5 Canvas, it is a solar system with the planets as buttons which enlarge and give info when hovered over, the only problem is sometimes other planets with orbit over the info making it hard to read.

Is there a html5 canvas/java equivelent of AS3's 'Bring Object To The Front' code snippet?

that bring an object to front on 'click' (or in my case 'mouseover')

/* Bring Any Clicked Object to the Front

Clicking on any symbol on the Stage moves it in front of all other instances.

*/

 

 

// This code makes all symbol instances on stage clickable by making them listen for the CLICK event.

for (var fl_ChildIndex_2:int = 0;

                    fl_ChildIndex_2 < this.numChildren;

                    fl_ChildIndex_2++)

{

          this.getChildAt(fl_ChildIndex_2).addEventListener(MouseEvent.CLICK, fl_ClickToBringToFront_2);

}

 

 

// This is the function that moves the clicked object to the front of the display list

 

 

function fl_ClickToBringToFront_2(event:MouseEvent):void

{

          this.addChild(event.currentTarget as DisplayObject);

}

 

Keep in mind, I am a designer not a programmer I only dabble in code if i have to,

 

any help would be greatly appreciated.

 

-Tanrer


Viewing all articles
Browse latest Browse all 13519

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>