Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 05-17-2012, 01:00 AM   #1
McDuck4
Registered User
 
Join Date: May 2012
Posts: 31
Default on (release)

Hello again everybody.

I wants to find a script i can use for linkin between scenes. Until now i used a cople like this:

stop();

Button1.addEventListener(MouseEvent.CLICK, Button1Event);



// Button1

function back_ovelseEvent(event:MouseEvent):void
{
Button1.addEventListener(MouseEvent.CLICK, clickHandler);
function clickHandler(e:MouseEvent) {
gotoAndStop("Button1");// Start your custom code
// This example code displays the words "Mouse clicked" in the Output panel.
trace("Mouse clicked");
// End your custom code
}
}

And

on(Release) {
gotoAndPlay("Button2")
}


But all those scripts i have to press two times before the link works. Does anybody know a script i can use, so i only have to click once?

Best Regards
Mads
McDuck4 is offline   Reply With Quote
Old 05-17-2012, 01:19 AM   #2
USAFDrew2011
Flash_Developer
 
Join Date: Jul 2011
Location: Layton City, Utah
Posts: 193
Default

are you using AS2 or AS3? The
ActionScript Code:
on(release)
function is utilized in AS2 only
USAFDrew2011 is offline   Reply With Quote
Old 05-17-2012, 06:27 AM   #3
McDuck4
Registered User
 
Join Date: May 2012
Posts: 31
Default

Im using AS3.
McDuck4 is offline   Reply With Quote
Old 05-17-2012, 07:00 AM   #4
USAFDrew2011
Flash_Developer
 
Join Date: Jul 2011
Location: Layton City, Utah
Posts: 193
Default

can you provide your .fla file?
USAFDrew2011 is offline   Reply With Quote
Old 05-17-2012, 07:07 AM   #5
McDuck4
Registered User
 
Join Date: May 2012
Posts: 31
Default

Hello again

thank you very much for your quick answer. Im just gonna upload my file a place, and then post a link here. hold on 2 min
McDuck4 is offline   Reply With Quote
Old 05-17-2012, 07:12 AM   #6
McDuck4
Registered User
 
Join Date: May 2012
Posts: 31
Default

My links from scene 1 (index )work, but the links "back" and "ovelse_1" on scene 2 (ovelser) dosent work.

I really dont understand. Maybee you or someone else can see why?

speedy sh/TXh4S/testscene1 fla

you have to add . between (speedy.sh) and (testscene1.fla) I cant ost links yet on the website here.

Thank you very much for your help.

best regards
Mads
McDuck4 is offline   Reply With Quote
Old 05-17-2012, 07:25 AM   #7
McDuck4
Registered User
 
Join Date: May 2012
Posts: 31
Default

The link problem i have been sitting with in 7 hours now, its driving me crazy. I cant get the links fx "back" on scene 2(ovelser to work). The link should go to the index page again.


Hope someone can help me
McDuck4 is offline   Reply With Quote
Old 05-17-2012, 04:09 PM   #8
[afz]snickelfitz
Senior Member
 
[afz]snickelfitz's Avatar
 
Join Date: Dec 2011
Location: Tucson, AZ
Posts: 2,406
Default

Build the sections of your project within MovieClips in the Library, or within external swf files if the sections contain a lot of bitmaps or other bandwidth-expensive content.
You can then just load/add/remove the sections from an Array.

Mazoonist has written a good tutorial on the subject, which also covers other important topics such as writing code in external class files (as opposed to frame-scripting), drag'n'drop, Objects, etc... it's a great beginner overview that promotes "proper" development techniques that you can build on.
http://www.actionscript.org/resource...ses/Page1.html
[afz]snickelfitz is offline   Reply With Quote
Reply


Thread Tools
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:31 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.