3 Replies Latest reply on Oct 5, 2015 1:50 AM by Sulvor

    Position an Item Via External JSon File and then on mouseover / Click load the ID

    Sulvor

      Hello Everyone,

       

      I come with what I think is an unusual request for help, and have been over heaps of different posts / tutorials and think I have it in part, however, I just want to check mostly..

      I have a "galaxy" map, that I want to position say "aStarSymbol" randomly on that map based on Coordinates it recieves from an external JSON file. (I am creating this JSON file via an export of SQL Data that is in turn linked to a Minecraft server.. Now I am fine with exporting the data out however I need into the Json File, thats actually not too bad (With help from my Database mate).. Now My Task is to. Use the data he can get, to position a STAR Symbol on the Map, (it flashes like a star)[Done that with timeline etc] then inside that I have a mouseClick event that brings up a new window (Also done, it where it pulls the data from a JSON file) and populates that popup, now my Thought for it was, Have the star that has 2 states, 1 just the star flashing, and 2, with the popup, and replace the symbol / hide / show when clicked etc) seems to work ok, , This is how I think it needs to be laid out.

       

       

           StarID : 0

           XCoOrd : 1900

           YCoOrd: 2100

           Info [

                 

                     Title :Earth

                     PlanetImage : images/Earth.png

                     Address :1499867

                     Races : Human

                     Technology : Iron Age

                     Interests : Water Abundant

                     Controlling : PKGuild

       

      Now I am not  particularly strong with JSON nor Edge Animate Really, as have only had a few weeks to work with it (but loving what I can do with it ).

       

      Only thing I severely seem to be lacking in is Position an Item (Symbol) Via External JSon File and then on mouseover / Click load the ID of that same Loaded external File, to fill in the Popup (I can fill it in if I manually type the data in the json as a single Name etc), but that would mean making a hell of a lot of info in the Json which shouldn't be required.. (

       

      The Current setup I have for the popup that needs info is:

      creationComplete:


      sym.setVariable("_title", JSONObject._title);

      sym.setVariable("_address", JSONObject._address);

      sym.setVariable("_race", JSONObject._race);

      sym.setVariable("_technology", JSONObject._technology);

      sym.setVariable("_interests", JSONObject._interests);

      sym.setVariable("_controlling", JSONObject._controlling);

       

      CompositionReady

      sym.$("_title").html(sym.getVariable("_title"))

      sym.$("_address").html(sym.getVariable("_address"))

      sym.$("_race").html(sym.getVariable("_race"))

      sym.$("_technology").html(sym.getVariable("_technology"))

      sym.$("_interests").html(sym.getVariable("_interests"))

      sym.$("_controlling").html(sym.getVariable("_controlling"))

       

      my JSON file has the following:

      var JSONObject = {

        //Planet _info

        "_planet" : "images/earth.png",

        "_title" : "Planet Earth",

        "_address" : "Cartooch",

        "_race" : "Human",

        "_technology" : "Dumbasses",

        "_interests" : "Sulvor",

        "_controlling" : "RIFTD"

        //Planet _info2

        }

       

      See Attached Image as the World and when Clicked the Popups (I want them to display next to the clicked Star.

      .2015-09-30 18_13_51-StargateMC - Milkyway.png2015-09-30 18_15_36-planetinfo.html - Adobe Edge Animate CC 2015.pngEarth.png

       

      but basically _planet will be the image that it changes 2, haven't put that code into the compositionReady / Complete just yet, As I have been flailing around to position a symbol based on External Json Value .. any help greatly appreciated.