Question

AS3, Navigation difficulties ("Scene Scene 1 was not found")

Asked by: cdebel

Flash is quite new for me so this question may be easy for you.

I've made a flash web site, with navigation menu on top of the page.  Each button lead to a different content page (each content page is contained in a single frame of the timeline).
I've a button inside a content page who should lead to a page in SCENE 1.  This button is included in a MovieClip object.

When i call this line, it tell me that "Scene 1" doesn't exist, but it should display the frame 3 on scene 1:
     gotoAndPlay(3, "Scene 1");

The exact message is: "Error #2108: Scene Scene 1 was not found."

PS: Keep in mind that It need to be in AS3.  So don't lose your time (neighter mine!).

Thanks a lot for your help

/* Here's the code in the action script of that specific frame where the button is visible.
   ibtnLienVisiteVirtuelle is the button itself.
 */
 
ibtnLienVisiteVirtuelle.addEventListener(MouseEvent.CLICK, NavigVisite2);
function NavigVisite2(event:MouseEvent):void
{
     gotoAndPlay(1, "Scene 1");
}

                                  
1:
2:
3:
4:
5:
6:
7:
8:
9:

Select allOpen in new window

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2009-08-19 at 08:40:08ID24665207
Tags

AS3

,

Flash

,

gotoAndPlay

Topics

ActionScript

,

Adobe Flash

Participating Experts
3
Points
500
Comments
14

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. moving to next scene
    Hi all i am developing a project in Flash MX 2004 it has 2 scenes, 1-preload scene, 2-main scene first it opens preload scene, and plays the loading animation, when it is loaded it should go to main scene and stops on the 1 frame of main scene ---- this code is on the ...
  2. Want to control the main timeline with as3
    How can I contol the main timeline or the timeline of a movieclip with as3? Thanks, R.
  3. AS3 gotoAndPlay(1, "Scene 2") in a MovieClip
    Hi, how to trigger gotoAndPlay(1, "Scene 2") in a MovieClip?
  4. Flash AS3 doesn't remember data between scenes
    I am building a Flash Projector application using AS3. The presentation uses different languages which are selected in the first scene. In that scene the program remembers which language has been chosen & reacts as expected. However when the menu in scene 1 takes you to a...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: VulturousPosted on 2009-08-19 at 22:08:45ID: 25139487

Scene navigation is case sensitive, perhaps there's an error there?

If it doesn't work, please post your fla so I can take a look at it.

-V

 

by: blue-geniePosted on 2009-08-20 at 02:41:15ID: 25140590

>> (each content page is contained in a single frame of the timeline).
have you created scenes? or are you trying to go to frames in the timeline?

 

by: kmead6Posted on 2009-08-20 at 06:23:05ID: 25142155

you always start in scene 1 by default so maybe try to give it a different scene name?

 

by: blue-geniePosted on 2009-08-20 at 06:31:54ID: 25142267

if you're using the default "scene" - you don't need to reference it.
if you are creating scenes you should consider not doing so.
rather create your content in different swfs and load them accordingly.

 

by: cdebelPosted on 2009-08-20 at 06:39:51ID: 25142346

Vulturous: The scene name is ok.  If i press Shift-F2, it appears in the list, and its written the same way (including cases).

Blue-Genie: Scene 1 exist no mather what you do.  I've not deliberatly created it myself.  I'm trying to go to a Specific Frame in the timeline of Scene 1.  As i specified, the "gotoAndPlay" is inside a movieclip.  So the movieclip have its own timeline.  So even if i'm trying to go to frame 3 on the main timeline (scene 1)... by just doing this: gotoAndPlay(3);   it won`t work because there's only 1 frame in that movieclip.  I want it to show the Frame 3 of Scene 1...

KMead6: I don't have any other scene...  maybe i'm wrong, maybe i designed my page the wrong way.  I would be glad if you give me some enlightment.  I'm just a noob with Flash (most of the time i program in VB.NET, C#, ASP.NET, PHP, etc).  

Does the content of each page in my project should be contained in a different scene?

 

by: cdebelPosted on 2009-08-20 at 06:41:26ID: 25142367

Blue-Genie: Ok you lost me there.  If i create single SWF file for each page content, i'll have to repeat the same navigation menu in each SWF.  So if i modify one, i'm dead... i've to modify it in every SWF.  Am i wrong?

 

by: kmead6Posted on 2009-08-20 at 06:45:41ID: 25142420

no matter what, even if you haven't created any scenes, you start on Scene 1. if you press Shift+F2 and see your scenes, is there just one scene listed? if so that's your flash website and you need to make another scene in order to jump to it with the gotoAndPlay command. You can press the Duplicate Scene button at the bottom of your scenes window to duplicate what you've already made (so you don't have to re-make everything) and rename the scene to be Scene 2 or whatever and then change you code to reflect the new scene. You can't jump to Scene 1 if you are already there (which by default you are).

 

by: cdebelPosted on 2009-08-20 at 07:17:11ID: 25142793

I've found my answer by googling a lot.  Here it is:
     (root as MovieClip).gotoAndStop(3);

Blue-Genie: As i specified, my previous comments, the gotoAndPlay (or Stop) is inside a MC, not directly in the main timeline... so just doing a gotoAndStop(3) won't work since frame 3 in the MC timeline doesn't exist.

I guess i'll have to find a good book for Flash because right now i'm learning here and there on the net, and i don't see any "Best Method" to do things.  I'll post my file, and thoses who want to comment on "where i went wrong" are free to post if they want to help me.

I'll split the points between all of you no mather what.

I think i should place my menu into an object library, so i could use it on any scene.  And each content page should be placed in a new scene.  So if i modify the menu in the library, the changes should reflect in every scenes.

If you check the file and run it, press "Click here to enter", then the problem i had will happen when you try to click "Visite virtuelle" (Not in the menu, but bellow with the blablabla).  But as i said, i've solved this problem.

 

by: VulturousPosted on 2009-08-20 at 08:21:39ID: 25143670

I get it now... sorry I kinda misunderstood the question.

Doing the following should work too:

<code>

Glad you got it sorted though.

-V

ibtnLienVisiteVirtuelle.addEventListener(MouseEvent.CLICK, NavigVisite2);
function NavigVisite2(event:MouseEvent):void
{
     event.currentTarget.parent.gotoAndStop(3);
}

                                              
1:
2:
3:
4:
5:

Select allOpen in new window

 

by: cdebelPosted on 2009-08-20 at 11:15:41ID: 31617675

Is there any book that you could suggest me to buy?

Don't forget that i've a strong developer background, so i'm not scared about books giving classes hierarchy and go deep into ActionScript.

A book that could also give me "the best method" to use to develop a large web site?

Thanks a lot

 

by: kmead6Posted on 2009-08-20 at 11:33:04ID: 25145683

hmm...a good book....
i taught myself flash with the flash cs3 professional visual quickstart quide, but that was mainly just to get associated with the interface and very very basic actionscript, and googling different things. i also have a very large Actionscript 3.0 book (the publisher's name escapes me now...) but it's big and has a drawing of a snake on it. i don't use it too much, mostly because i'm intimidated by it, but if you have a strong developer background it might be for you.

 

by: VulturousPosted on 2009-08-20 at 12:19:38ID: 25146075

This one is good:

http://livedocs.adobe.com/flex/3/progAS_flex3.pdf

It's mainly aimed at Flex development, but it has a big bunch of "Programming AS3" that is quite helpful.

Cheers!

-V

 

by: cdebelPosted on 2009-08-20 at 12:37:34ID: 25146220

Wow, thanks!
For sure i'm going to try Flex someday.
But this book seems to give some samples of AS.  

 

by: blue-geniePosted on 2009-08-20 at 22:11:05ID: 25149261

i think the book with the snake on it is the o'reily colin moock book. His books are good especially for someone with a developer background.

in terms of best practise, I think that's like saying what's your favorite colour, I advise against scenes for the very simple reason, it become a nightmare to target them. But then I think you're confusing the display objects and their timelines with scenes.
once you start getting stuck into developing class and object structures you can create custom events which are awesome to do all sorts of stuff.

your reference to scene1 in your original post should have been 'main timeline'
happy flash journey.s

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...