FlashMX04 Qs?!
- Started
- Last post
- 13 Responses
- numero1
I created a invisible button in flash. And I used it in the main scene for different links that are going to go to the othe pages of the site. All the other pages are HTML. Only the home page is a flash file.
How do I link each button in the file to the other HTML pages of the site.
I typed this:
on[release] [
getURL(accessories.html);
]but it didn't work!
Help thanks!
- unfittoprint0
advisable not to use events directly on buttons after FlashMX.
give a name to your button using the properties inspector [ie. triggerLink],
ceate an action layer and write:triggerLink.onPress = function(){
getURL("mypage.html", "_blank");
}
- numero10
I was positioning the button intances in the same layer as the "movie clips" that are going to go to the specific HTML pages.
Is that possible ?
- Nematoth0
on[release]
{
getURL(accessories.html);
}
- Nematoth0
em....
meant to say this:on(release)
{
getURL(accessories.h tml);
}
- torres0
Nematoth is right. You just had a syntax error.
in one place you were using "[]" instead of "()" and in another place you were using "[]" instead of "{}".
Even though this will work it's better to keep your code off the buttons.
- torres0
one more thing... you also need to have the path to your page in quotes.
If it's not in quotes flash thinks it's a variable or an equation
- numero10
no I was just using "[]" cos I thought {} wouldnt work in here...
Cos sometimes it doesnt.on(release){
getURL(accessories.html);
}so yeah?!
- Nematoth0
on(release){
getURL("accessories.html");
}so why is it better to keep code off the buttons? Performance? Just curious....
- torres0
I guess as far as Flash is concerened there are really no such things as buttons anymore... at a system level it treats them like movie clips.
I don't really know all the details but in addition to that it's much easier to manage all of your code if it's on one key frame.
If you're interested I could write a little more about it, but I don't want to needlessly bore anyone.
- numero10
yeah It would be okay
But would it be ok if a email you the fla and maybe you could see what I mean with the buttons?
Cheers
- torres0
yeah. for sure...
- j_red0
torres check your email.
- Mick0
so why is it better to keep code off the buttons? Performance? Just curious....
Nematoth
(aug 19 04, 18:30)
-----------------------Macromedia has introduced a 'best practice' of seperating all code from user interface. So when you want to edit a button, you don't have to find the MC/button with the actions - all your code will be in one frame.
They also recommend putting all your AS code into the first frame of a movie for usability (screen readers for the disabled can only read the content of the first frame). This is becoming a requirement of some government sites that have to be usability enabled.