Trying to get current scene name to appear as a label for each scene

  • I figured it was something simple, but couldn't crack the code - was hoping one of you guru's might have a quick solution!

    Nothing fancy, or AS3 oriented, I'm just trying to get the current scene name to appear in the upper right hand corner of my pano for each scene, need it to update as a user changes scenes - something global that reads the scene name and puts it in a global plugin (so I don't have to add code to every pano!)

    I've got a large tour with 50 or so panos, and I'd like my client to be able to easily determine the name of scene they are looking at - makes communication that much easier...

    Any help is much appreciated!

  • create a textfield plugin outside the scenes

    Code
    <plugin name="tf" url="plugins/textfield.swf" align="topright" html="" keep="true" css="data:niceCSS" />

    then you add an event. Not sure which one, since I dont often work with scenes. I think onpreviewcomplete will work

    Code
    <events onpreviewcomplete="updatetitle()" />

    the action:

    Code
    <action name="updatetitle">
      txtadd(_html, <p>, get(xml.scene), </p>);
      copy(plugin[tf].html,  _html);
    </action>

    if xml.scene doesnt work, try scene.name

    pretty it up with css:

    Code
    <data name="niceCSS">
    p{
       color: #FFFFFF;
       font-family: Verdana;
       font-size: 14px;
    }
    </data>
  • Zephyr - thanks for the help! I gave it a try (both ways) and couldn't get it to work (I did get a large textbox in the corner - contents in white letter on white background - all it said was "null")... I'll keep chipping away at it...

  • ah sorry, default setting of textfield is with a white background, add a background="false" to it.

    concerning it saying null, is weird... try onxmlcomplete or onloadcomplete... instead of onpreviewcomplete

    the events should alsoo be outside the scene, and not be overwritten by another event in your scene. another possible way would be adding the updatetitle() to the onstart of the scene, but that would be redundant code...

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!