A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Stumped on something that seems so simple

Hybrid View

  1. #1
    Junior Member
    Join Date
    Nov 2009
    Posts
    6

    Stumped on something that seems so simple

    OK, so I have two scenes.
    Within scene 1 (named view), I have a movie clip called "rooms".

    Scene 1 (view)
    --> rooms
    --> labeled frame called "paintingview"

    I also have a second scene called Details. In Details, I have a button, which is supposed to link back to a frame label called "paintingview" which is stored within Scene 1 within a movie clip labeled "rooms".

    OK, so simply, I tried coding the button on scene 2(Details), to goto Scene 1(view), movie clip (rooms), frame label (paintingview)

    I have tried numerous combinations, none of which seem to work.

    The latest code I have seems the closest, but I get a not found error.

    My code looks like this:

    BUTTON ACTION:
    on (release) {
    tellTarget("_root.view.rooms"){
    gotoAndPlay("paintingview");
    }
    }

    Getting this error:

    Target not found: Target="_root.WalkThrough.rooms" Base="_level0"

    Can some flash genius help me with this?

  2. #2
    Junior Member
    Join Date
    Nov 2009
    Posts
    6
    Oh, and it is flash cs3 action script 2 if that info is needed.

    Many thanks to anyone who can help guide me.

  3. #3
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    Well the error says it. But there are other errors. From what i understand, the movieclip with instance name rooms sits on the main timeline (named _root or _level0), so to target it you'd just need to say _root.rooms.
    But form the error, it looks like rooms is yet in another movieclip instance name WalkThrough. so first make sure you have your paths correctly.

    Now for your problem, you'll need to:
    1st send the timeline to a frame in Scene 1 where _rooms is present. For that just label that frame, for exemple roomsFrame:

    PHP Code:
    _root.gotoAndStop("roomsFrame"); 
    2nd, you are going to need some function to send _rooms to the correct label upon landing on that roomsFrame label. You can use a variable. That would come handy if you have other buttons that send _rooms to other labels than "paintingview".

    For example - On The main timeline declare that variable, chosenLabel (empty String to start with):
    PHP Code:
    _level0.chosenLabel =""
    on frame 1 of _rooms, add this script:
    PHP Code:
    this.gotoAndStop(_level0.chosenLabel); // variable value given by the buttons 
    On your button that send the main timeline to "roomsFrame" add this:
    PHP Code:
    _level0.chosenLabel "paintingview"
    That should correct the problems.

    On a side note, in the future, do not use Scenes unless there is nothing common in them. Also ditch tellTarget, it has been deprecated for at least 10 years now.

    gparis

  4. #4
    Junior Member
    Join Date
    Nov 2009
    Posts
    6

    Thank you, thank you!

    Perfect solution, and works like a charm.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center