A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: Help to add button and link it to another page within flash animation

  1. #1
    Junior Member
    Join Date
    Jan 2015
    Posts
    4

    Help to add button and link it to another page within flash animation

    Good Evening,

    I would like to ask for a help!

    I am working on flash website for my wife and really struggling …. I would like to create a button on e.g. Home page (Page 1 – Movie Clip) with a link which will open another page within the flash animation e.g. Contact (Page 6 – Movie Clip). So far I have added a button “Enter” to Home page with link is not working. I am not sure what script is needed to be put there …
    Template was created in Flash MX2004, I am using Flash Pro 8.

    Could someone have a look at flash file (www.svadobnedekoracie.eu/html/flash.fla) and help please ?

    Testing website is uploaded here: www.svadobnedekoracie.eu/html/

    Thank you very much for your help!

    Dan

  2. #2
    Client Software Programmer AS3.0's Avatar
    Join Date
    Apr 2011
    Posts
    1,404
    button_name_here.onRelease = function() {
    getURL("http://www.yoursite.com", "_blank");
    }

  3. #3
    Junior Member
    Join Date
    Jan 2015
    Posts
    4
    Hello Alloy Bacon,

    thank you for your reply.

    I have added the below to the button I have placed to page 1 movie clip:

    button2.onRelease = function() {
    getURL("http://svadobnedekoracie.eu/html/", "_blank");
    }

    button2 is the name of button

    But there is an error message:
    **Error** Symbol=page1, layer=Layer 3, frame=1:Line 1: Statement must appear within on handler
    button2.onRelease = function() {

    Total ActionScript Errors: 1 Reported Errors: 1

    Any idea what I am doing wrong?

    Flash file can be downloaded here: www.svadobnedekoracie.eu/html/flash.fla

  4. #4
    Banned
    Join Date
    Dec 2014
    Posts
    2

    good

    it is very nice!

  5. #5
    Prid - Outing Nig 13's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    1,864
    Hi,

    usually templates are made in a rather complex and organized manner which can lead to a lot of nested codes and many factors to consider even when trying to execute the slightest action -- thankfully in your case, the template relatively simplified, and after analysing your templating a bit, the easiest solution I've come up with is to put this code on your button:

    Code:
    on(release){
    	_root.gotoAndPlay("page6");
    }
    I haven't tested this code properly, so keep an eye out for possible errors that may occur subsequently, but hopefully this is enough and does the trick for you As you can see, the transition to the other page isn't as smooth as the rest of the template, but this is the simplest code to fix your problem, so hopefully it'll do

    It probably goes without saying, but just change the number of the page to whatever suits your needs, like "page2", "page3", etc.

    If you want an explanation for why this works and what you did wrong, then feel free to ask.

    I hope this helps you
    I am back, guys ... and finally 18 :P

    BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS

  6. #6
    Junior Member
    Join Date
    Jan 2015
    Posts
    4
    Quote Originally Posted by Nig 13 View Post
    Hi,

    usually templates are made in a rather complex and organized manner which can lead to a lot of nested codes and many factors to consider even when trying to execute the slightest action -- thankfully in your case, the template relatively simplified, and after analysing your templating a bit, the easiest solution I've come up with is to put this code on your button:

    Code:
    on(release){
    	_root.gotoAndPlay("page6");
    }
    I haven't tested this code properly, so keep an eye out for possible errors that may occur subsequently, but hopefully this is enough and does the trick for you As you can see, the transition to the other page isn't as smooth as the rest of the template, but this is the simplest code to fix your problem, so hopefully it'll do

    It probably goes without saying, but just change the number of the page to whatever suits your needs, like "page2", "page3", etc.

    If you want an explanation for why this works and what you did wrong, then feel free to ask.

    I hope this helps you
    Thank you sooooo much, it is working :-)

  7. #7
    Prid - Outing Nig 13's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    1,864
    Glad I could be of help -- I hope your wife likes the website as it is wonderful
    I am back, guys ... and finally 18 :P

    BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS

  8. #8
    Junior Member
    Join Date
    Jan 2015
    Posts
    4
    Me wife love it but unfortunately it looks like I will need to redesign it or create mobile version as it is not accessible by mobile phones as iPhone/Android.

  9. #9
    Prid - Outing Nig 13's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    1,864
    Oh, that is such a shame Apple refuses to support Flash, so none of their mobile devices will be able to run Flash files -- as for Android, I do believe it should work, but I could be wrong. To re-create such an amazing website in something like HTML5 to support mobile devices would be quite a challenge, as Flash is unmatched when it comes to how easily you can add interactivity to a website. But I hope you find a solution for that though, all the best
    I am back, guys ... and finally 18 :P

    BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS

  10. #10
    Senior Member realMakc's Avatar
    Join Date
    Oct 2002
    Posts
    927
    if you convert your scripts to as3 (thus keeping the artwork) you can then package this as an app using AIR and publish in ios/google stores.
    who is this? a word of friendly advice: FFS stop using AS2

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center