1 Reply Latest reply on Nov 13, 2011 4:53 PM by kglad

    image link to different scene?


      Hi, I'm new to flash/actionscript and searching google and the forums have not helped (perhaps I'm using the wrong terms).


      I'd like to call up a scene when an image is pressed. I understand, I think, where the image is located on xml and the fla/actionscript. Here are the corresponding parts.




      <image imageUrl="_pic16.png" link="asfunction:link"/>





      onClipEvent (load)


          imageProperties = _root.getCurrentImageName(16);

          loadMovie(_root.url + imageProperties.name, this.cont.pic);

          loadMovie(_root.url + imageProperties.name, this.cont.pic1);

          url = imageProperties.linkToOpen;

          targetWindow = imageProperties.target;




      I was thinking I could edit the xml part to:


      <image imageUrl="_pic16.png" link="asfunction:_root.more_click_func,0"/>


      However, it does nothing.


      What am I missing here? I appreciate your time and effort for helping.

        • 1. Re: image link to different scene?
          kglad Adobe Community Professional & MVP

          1.  you shouldnt' attach code to objects.  attach to a frame if you're coding on a timeline.


          2.  you need to load your xml:  use the xml class.


          3.  parse the xml in an onLoad or onData method and load your image into a target movieclip


          4.  after loading of your image is complete (use preloader code), apply your onPress method to the target movieclip