Quantcast

silly actionscript woes, changing scenes of an object in a object on click.

Created by Rallier on July 16, 2012, 10:57 a.m.

  • Not too long ago i took on a first job relating to using flash where i had to fill in the content of a pre bought template site. Not too big of a deal i thought initially but boy oh boy was i wrong.

    After a ton of cursing at the abysmal naming of the different objects in the library i finally got everything as i wanted to except one thing, not all the pages were there.

    What i am trying to do is to get a different scene from an object to load when clicking a button, it sounded simple in my head but it turned out not to be that straight forward and I've spend more hours than i care to admit trying to pull it off.

    there is the actual page which contains the button object, in this there is the scene scrolling object, and in that is the object that i want to change the scene off.

    the following code is what is used by the header buttons to go to the actual page, i've tried every single variation on it that i could think of to pull of what i want to do.

    • on (release) {
    • if (_root.link<>num and _root.animation == 1) {
    • _root.animation = 0;
    • _root.link_prev = _root.link;
    • _parent["item"+_root.link].gotoAndPlay("s2");
    • _root.link = num;
    • _root.play();
    • }
    • }

    I think that i need to do something along the lines of _parent.nameofthescroller.nameoftheobject.gotoAndPlay("s2");

    Any help would be much appreciated.