Flash Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignFlash Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 9th, 2004, 12:22 PM
pxdphil pxdphil is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 13 pxdphil User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Actionscript/navigation problems

I'm making a pretty basic 4-page flash site (including a preloader).

The Preloader is in Scene 1, with a short animated intro in Scene 2. The main site is a movie clip within the last frame of Scene 2.

The different pages of the site are the first 4 frames of the movieclip. Originally (when the site was just in its own scene) I used the following action to navigate between pages:

------------------------
on (release) {
with (_level0) {
gotoAndStop (X);
}
}
------------------------

where X is the frame number of the corresponding page of the site.


When I made the site a movieclip in Scene 2, I used the following command:

-------------------------
on (release) {
with (_level0.instance12) {
gotoAndStop (1);
}
}
-------------------------


When I run the .swf on my computer everything works fine. However, when I upload and run it on my server, the navigation links don't work.

Any ideas why?


[the site is at http://www.pxdnet.co.uk/RSH/minisite.htm ]

Reply With Quote
  #2  
Old February 9th, 2004, 01:16 PM
jmichels's Avatar
jmichels jmichels is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Location: Orlando, FL
Posts: 177 jmichels User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 18 m 12 sec
Reputation Power: 6
It would be pretty hard to tell without looking at your .fla I noticed though, that you've used the "with" command, when you really don't need too. The following examples would suffice for switching keyframes or jumping to other scenes:

Code:
gotoAndStop(1);


Code:
gotoAndStop("Scene 2", 1);


If that doesn't work, you could also try different syntax. Instead of referring to the _level, you could use _root Let me know if it works.

Reply With Quote
  #3  
Old February 9th, 2004, 01:27 PM
pxdphil pxdphil is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 13 pxdphil User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
How would I specify a movieclip to go to and stop?

Reply With Quote
  #4  
Old February 9th, 2004, 01:32 PM
jmichels's Avatar
jmichels jmichels is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Location: Orlando, FL
Posts: 177 jmichels User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 18 m 12 sec
Reputation Power: 6
There are many different methods that you can use. You will need to set an instance name for the movie clip. In the following example, I have used "clip" to goto and stop on frame 2.

Code:
_root.clip.gotoAndStop(2);

Reply With Quote
  #5  
Old February 9th, 2004, 01:41 PM
pxdphil pxdphil is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 13 pxdphil User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Using

gotoAndStop(1);

The movie just goes to frame 1 of scene 1.



The _root method seems to have exactly the same effect as _level0.


The problem is I need to specify a frame within a movieclip within a scene. The gotAndStop(); function only has 2 parameters.

Reply With Quote
  #6  
Old February 9th, 2004, 01:48 PM
pxdphil pxdphil is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 13 pxdphil User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Using what you suggested, the actions associated with the buttons are now:

----------------------------

on (release) {
_root.clip.gotoAndStop(2);
}

----------------------------


This doesnt seem to do anything at all

Reply With Quote
  #7  
Old February 9th, 2004, 01:53 PM
jmichels's Avatar
jmichels jmichels is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Location: Orlando, FL
Posts: 177 jmichels User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 18 m 12 sec
Reputation Power: 6
I used gotoAndStop(1); just to demonstrate a workaround for your navigational buttons, rather than using the with command. With regard to jumping to another scene and then a frame inside a specific movie clip, the following code will work:

Code:
gotoAndStop("Scene 2", 1);
clip.gotoAndStop(2);


_root.clip.gotoAndStop(2); doesn't go inside your button in the clip. It should be placed on the root ine a keyframe and it tells the movie clip which frame to jump too. The buttons inside the movie clip, would use different commands just for going to different frame numbers. For instance gotoAndStop

Last edited by jmichels : February 9th, 2004 at 02:01 PM.

Reply With Quote
  #8  
Old February 9th, 2004, 02:08 PM
pxdphil pxdphil is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 13 pxdphil User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks for your help.

It seems to be working now using this [and the site movieclip defined as 'clip']

-----------------------------------------------
on (release) {
with (_root.clip) {
gotoAndStop(1);
}
}
-----------------------------------------------


This is probably a longwinded way of doing it but if it works then I'm not complaining.

Thanks again.

Reply With Quote
  #9  
Old February 9th, 2004, 02:15 PM
jmichels's Avatar
jmichels jmichels is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Location: Orlando, FL
Posts: 177 jmichels User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 18 m 12 sec
Reputation Power: 6
Glad it works for you. You can really bypass that though, with:

Code:
on (release) {
    _root.clip.gotoAndStop(1);
}


The with command is primarily used for not having to write in the instance name every time you have a whole lot of actionscript associated with the same clip.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignFlash Help > Actionscript/navigation problems


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT