Go Back   kirupaForum > Flash > Flash CS4

Reply
 
Thread Tools Display Modes
Old 11-27-2009, 07:59 AM   #1
mindeliz
Registered User
Location Copenhagen, Denmark

Posts 5
Go to Top button

Hello,

I'm doing a website and I made button to go to next page, stage is 800x1650 px, so when I press this button I'm on the next page, but in bottom of the next page. Now the simply code I have for this button is:

on(release){gotoAndPlay("exhibitions3");}

Maybe someone could help me with extra code to go on top of the page..
mindeliz is offline   Reply With Quote

Sponsored Links (Guests Only) - Register | Need Help?
 

Old 11-27-2009, 08:50 AM   #2
Swooter
Swooter - AS/JS/HTML/CSS
 
Swooter's Avatar
This might work:

ActionScript Code:
import flash.external.ExternalInterface;
on(release){
  if ( ExternalInterface.available ) {
    ExternalInterface.call("eval", "window.location.href='#top';void 0;");
  } else {
    getURL("javascript:window.location.href='#top';void 0;");
  }
  gotoAndPlay("exhibitions3");
}

__________________

AS / JS / HTML / CSS / PHP
Swooter is offline   Reply With Quote
Old 11-27-2009, 09:26 AM   #3
mindeliz
Registered User
Location Copenhagen, Denmark

Posts 5
Quote:
Originally Posted by Swooter View Post
This might work:

ActionScript Code:
import flash.external.ExternalInterface;
on(release){
  if ( ExternalInterface.available ) {
    ExternalInterface.call("eval", "window.location.href='#top';void 0;");
  } else {
    getURL("javascript:window.location.href='#top';void 0;");
  }
  gotoAndPlay("exhibitions3");
}
Thank you for help, but flash shows error: "Statement must appear within on handler; import flash.external.ExternalInterface;"
mindeliz is offline   Reply With Quote
Old 11-27-2009, 11:52 AM   #4
Swooter
Swooter - AS/JS/HTML/CSS
 
Swooter's Avatar
Yes, this is because an import should be on a actionscript layer...

- Remove the code from the button itself.
- Give the button an instance name, such as MyButton
- Click on frame 1 of the layer that contains the button and paste this code in the actions panel:


ActionScript Code:
import flash.external.ExternalInterface;
MyButton.onRelease = function() {
  if ( ExternalInterface.available ) {
    ExternalInterface.call("eval", "window.location.href='#top';void 0;");
  } else {
    getURL("javascript:window.location.href='#top';void 0;");
  }
  gotoAndPlay("exhibitions3");
}

__________________

AS / JS / HTML / CSS / PHP
Swooter is offline   Reply With Quote
Old 11-28-2009, 02:36 PM   #5
mindeliz
Registered User
Location Copenhagen, Denmark

Posts 5
Quote:
Originally Posted by Swooter View Post
Yes, this is because an import should be on a actionscript layer...

- Remove the code from the button itself.
- Give the button an instance name, such as MyButton
- Click on frame 1 of the layer that contains the button and paste this code in the actions panel:


ActionScript Code:
import flash.external.ExternalInterface;
MyButton.onRelease = function() {
  if ( ExternalInterface.available ) {
    ExternalInterface.call("eval", "window.location.href='#top';void 0;");
  } else {
    getURL("javascript:window.location.href='#top';void 0;");
  }
  gotoAndPlay("exhibitions3");
}

Hi, Swooter,

it's working. Thank you thank you thank you !!!! : )**
mindeliz is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 -4. The time now is 06:04 PM.

SUPPORTERS:

kirupa.com's fast and reliable hosting provided by Media Temple. flash components
Creative web apps. Make your own free flash banners and photo slideshows.
Check out the great, high-quality flash extensions. Buy or sell stock flash, video, audio and fonts for as little as 50 cents at FlashDen.

Flash Transition Effects

Flash Effect Tutorials

Digicrafts Components
Flash effects. Art without coding. Upload, publish, deliver. Secure hosting for your professional or academic video, presentations & more. Screencast.com
Streamsolutions Content Delivery Networks Flipping Book - page flip flash component.
Flash-Gallery.com - Get your flash photo gallery (flash component or swf gallery Learn how to advertise on kirupa.com
 

cdn
content delivery network (cdn)

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd. Copyright 2010 - kirupa.com Copyright 2010 - kirupa.com