Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

put a “back” button in front on an embed map

Contributor ,
Jun 22, 2014 Jun 22, 2014

Hi all,

I've integrate a map from MapQuest in my Adobe Air app (in AS3).

The map is taking all the screen, as I want.

BUT, I'd like to add a "back" button in order to go back to the previous menu.

Here's my code :

var NoumeaNord:TileMap = new TileMap("KEYcode");

            //set the size of the map

            NoumeaNord.size = new Size(800, 533);

            //add the map to the sprite.

            addChild(NoumeaNord);

              NoumeaNord.addControl(new SMLargeZoomControl());

              NoumeaNord.addControl(new MouseWheelZoomControl());

              NoumeaNord.addShape(new Poi(new      LatLng(-22.2758000,166.4580000)));

              NoumeaNord.setCenter(new LatLng(-22.2758000,166.4580000),15);

         function addBackBtn():void{

            var back:MovieClip;

                    back = new backBtn

            addChild(back);

            back.x = 0;

            back.y = 400;

            setChildIndex(back,0);

}

Don't know why but the BackBtn won't be in front of the map ! I've tried with setChildIndex(back,-1); but it makes an error : "RangeError: Error #2006: index is off limit".

Any idea ?

TOPICS
ActionScript
183
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Jun 23, 2014 Jun 23, 2014
LATEST

try

setChildIndex(back,this.numChildren-1);

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines