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 July 23rd, 2008, 05:16 AM
Cer0 Cer0 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2008
Posts: 2 Cer0 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 m 25 sec
Reputation Power: 0
ActionScript 3 - GotoAndStop(); not running along with ENTER_FRAME?

heya, theres probably a simple fix for this, but i dont get it.

the code is a mess and I guarantee some nooby items there, but it should all work, basically my button will do all its told in the function it runs, EXCEPT the jump to the next stage frame label? I think this is something to do with the enter_frame's i have going? any ideas?

Code:
select1.addEventListener(MouseEvent.CLICK , nStage2);
stage.addEventListener(Event.ENTER_FRAME , movement2);
stage.addEventListener(Event.ENTER_FRAME , movementb2);

function movementb2(event:Event):void
{
	panpoint.distance = 115 - panpoint.mouseX
}

function movement2(event:Event):void
{
	
if (cityL1.x > 575) {
cityL1.x = 575;
} else if (cityL1.x <310) {
cityL1.x = 310;
}
	
if (cityL2.x > 575) {
cityL2.x = 575;
} else if (cityL2.x <310) {
cityL2.x = 310;
}	
if (cityL3.x > 875) {
cityL3.x = 875;
} else if (cityL3.x <510) {
cityL3.x = 510;
}

var mod2a = cityL1.scaleX/105;
cityL1.x+=(panpoint.distance/10)*mod2a;

var mod2b = cityL2.scaleX/85;
cityL2.x+=(panpoint.distance/10)*mod2b;

var mod2c = cityL3.scaleX/65;
cityL3.x+=(panpoint.distance/5)*mod2c;
}

function nStage2(event:MouseEvent):void
{
	
	
	stage.removeEventListener(Event.ENTER_FRAME , movement2);
	stage.removeEventListener(Event.ENTER_FRAME , movementb2);
	cityL1.mouseEnabled = false;
	cityL2.mouseEnabled = false;
	cityL3.mouseEnabled = false;
	panpoint.mouseEnabled = false;
	gotoAndStop("stage2");
	trace ("clicked");
}
stop();

Reply With Quote
  #2  
Old July 23rd, 2008, 07:03 PM
Tann San Tann San is offline
Gotta get to the next screen..
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Nov 2003
Location: Legion of Dynamic Discord
Posts: 4,714 Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)  Folding Points: 10093 Folding Title: Novice Folder
Time spent in forums: 3 Weeks 1 Day 11 h 8 m 12 sec
Reputation Power: 580
Facebook MySpace
Heya, the first argument of gotoAndStop() has to be either a frame label or a frame number. The second argument is the stage name to jump to (which is optional). Try:

this.gotoAndStop(1, "stage2");
__________________
-Tann

-Vote for your favorite ActionScript editor here.

Reply With Quote
  #3  
Old July 24th, 2008, 03:15 AM
Cer0 Cer0 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2008
Posts: 2 Cer0 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 m 25 sec
Reputation Power: 0
Ta for the reply.

I know what your saying, however I have the frame labelled 'stage2' I tried changing it to 'secondscene' and nothing still. Also I just tried this.gotoAndStop(2); and gotoAndStop(2); as its the 2 frame really that im targetting here, but it just doesnt do that part of the function. :S

Thanks so far.

Reply With Quote
  #4  
Old July 24th, 2008, 06:30 AM
Tann San Tann San is offline
Gotta get to the next screen..
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Nov 2003
Location: Legion of Dynamic Discord
Posts: 4,714 Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)  Folding Points: 10093 Folding Title: Novice Folder
Time spent in forums: 3 Weeks 1 Day 11 h 8 m 12 sec
Reputation Power: 580
Facebook MySpace
hmmm so is the nStage2 function written inside the MovieClip you want to move the playhead on? I just assumed it was...

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignFlash Help > ActionScript 3 - GotoAndStop(); not running along with ENTER_FRAME?


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 5 hosted by Hostway
Stay green...Green IT