Simple problem I can't solve in Flash

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

sticker

Thread Starter
Joined
Sep 27, 2002
Messages
351
Hey all,

I enclose a link to my fla file below:
www.statesidecustom.com/main.fla

The problem is simple - I cannot add a hyperlink to the four main navigation images...

The possible problem might be that I am using the head from a full flash template and want to simply add .html page links to the four boxes when clicked on.

Any help would be very much appreciated!

To make things a little easier here's the code for one of the buttons - linking to a seperate flash page now, but I want to change the link to a html page:

Code:
on (rollOver) {
    if (_root.link<>1) {
        this.gotoAndPlay("s1");
    }
}
on (releaseOutside, rollOut) {
    if (_root.link<>1) {
        this.gotoAndPlay("s2");
    }
}
on (release) {
    if (_root.link<>1 and _root.flag_animation1 == 1) {
        _root.flag_animation1 = 0;
        _root.menu["item"+_root.link].gotoAndPlay("s2");
        _root.link = 1;
        _root.scrollPART.gotoAndStop(2);
        _root.scroller.scroller.gotoAndStop(3);
        _root.gates.play();
 
Joined
Jul 28, 2008
Messages
1,899
Judging from the code provided you are using Actionscript 2. If you want to open a Url using Actionscript, you can use the getURL() method.
 

sticker

Thread Starter
Joined
Sep 27, 2002
Messages
351
I'm not that familair with actionscript, would you mind altering the code I gave to include a getURL() command please?

It'd be very much apppreciated!
 
Joined
Jul 28, 2008
Messages
1,899
The Actionscript you provided contained depreciated functions, operators and methods, so I updated your code for you. The following code should be place on the buttons parent timeline, as well as replacing all instances of ButtonName to reflect the instance name of your button.

Code:
ButtonName.onRollOver = function() {
    if (_root.link != 1) {
        ButtonName.gotoAndPlay("s1");
    }
};
ButtonName.onRollOut = function() {
    if (_root.link != 1) {
        ButtonName.gotoAndPlay("s2");
    }
};
ButtonName.onRelease = function() {
    if (_root.link != 1 and _root.flag_animation1 == 1) {
        _root.flag_animation1 = 0;
        _root.menu["item"+_root.link].gotoAndPlay("s2");
        _root.link = 1;
        _root.scrollPART.gotoAndStop(2);
        _root.scroller.scroller.gotoAndStop(3);
        _root.gates.play();
    }
    getURL("http://www.google.com");
};
 

sticker

Thread Starter
Joined
Sep 27, 2002
Messages
351
Wow Thanks!

There are four buttons with relatively the same code. Should I just replace those code snippets with the code you provided and change the ww.google.com to say home.html, about_us.html etc?

Again, I apppreciate all the help!
 
Joined
Jul 28, 2008
Messages
1,899
Yes, you could do that, however you will need to change all instances of ButtonName in each snippet to reference the button you are targeting.
 

sticker

Thread Starter
Joined
Sep 27, 2002
Messages
351
I don't think it worked - see enclosed swf below.

The function of the buttons has an animation where "servcies" "gallery" text appears on rollover as well as a graphic effect. All I need is for the icons to be 'hot' to click to corresponding pages I've created within the site.

As you can see for the link below, the new code is disabling the text and rollover effect and not creating the link: the other boxes work - but as I said, I can't make them hot to link to pages within the site...

www.statesidecustom.com/main-Copy.swf

I'm sorry, but I'm not articulate with coding so any help writing the custom code would be appreciated. I have enclosed the origional fla above if need be...

www.statesidecustom.com/main.fla
 
Joined
Jul 28, 2008
Messages
1,899
Open the library by pressing Control & L > Locate the All Buttons symbol and double click it > Click on the About Us button > Give it a sensible instance name in the properties panel > Double click the About Us button > Single click the symbol in the button to show the Actionscript in the Actionscript panel > Delete this Actionscript > Navigate back to the All Buttons symbol > Place my code on the timeline, replacing all instances of ButtonName with the instance name you assigned to the About Us button > Repeat these steps for each individual button. This should solve your problem.
 

sticker

Thread Starter
Joined
Sep 27, 2002
Messages
351
Will this option still hold onto the rollover effect already there?
 
Joined
Jul 28, 2008
Messages
1,899
The steps provided in my previous post will replace the old Actionscript with the updated Actionscript, without changing any of the effects, such as roll over's, etc.
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Top