4 Replies Latest reply on Jan 8, 2014 3:05 AM by Sangeeta J Yelamali

    Bring to front for HTML5 Canvas


      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;



                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.