-
How can i make a hyperlink button (image) on a customizable excisting flashsite
Hello peeps,
I have downloaded a .fla from a site.
A complete site that you can customize with your own colors etc etc...
Now, i want to make 3 images (buttons) wich link to my facebook, twitter and Linkedin pages. New blank page!
I tried several getURL AS codes
I use Flash CS4 with AS3
The problem is, this site already has 1 layer with some AS3 in it.
Coz there are several movies, buttons etc
But when i make a new layer with a button, and a layer above with the AS3
it screws up the existing AS3 already present in the file. The whole site is trippin' when i preview the .swf file
My question is: do i need to put the buttons in the existing main layer, and the new AS3 for the hyperlinks in the already existing Actions layer?
Or can i make these buttons and AS3 in new layers?
This is the AS from the Actions layer in my site (only frame 1!)
(It has in total 80 frames)
Can Anyone help me??
// C o p y r i g h t © f l a s h m o . c o m
// D e v e l o p e d b y M i n T h u
fm_button.visible = false;
// To make a link to an external page, write label as "Label|URL" in array value
// EXAMPLE 1: "Flash Templates|http://www.flashmo.com/page/1"
// EXAMPLE 2: "Donate|http://www.flashmo.com/donate"
var menu_label:Array = new Array("Home", "Photography", "Creative",
"Agenda", "Links", "Contact");
var total:Number = menu_label.length;
var i:Number = 0;
var page:Number;
var main_menu:MovieClip = new MovieClip();
stage.addChild(main_menu);
for( i = 0; i < total; i++ )
{
var btn = new flashmo_button();
btn.name = "btn" + i;
btn.x = fm_button.x + 120 * i;
btn.y = fm_button.y;
btn.item_no = i;
btn.addEventListener(Event.ENTER_FRAME,btn_enter);
var each_substring:Array = menu_label[i].split("|");
btn.flashmo_button_label.fm_label.text = each_substring[0];
btn.item_url = each_substring[1];
main_menu.addChild(btn);
}
function btn_over(e:MouseEvent):void
{
e.target.over = true;
}
function btn_out(e:MouseEvent):void
{
e.target.over = false;
}
function btn_click(e:MouseEvent):void
{
var mc = e.target.parent;
if( mc.item_url != undefined )
navigateToURL( new URLRequest( mc.item_url ), "_parent" );
else
change_page(mc.item_no);
}
function btn_enter(e:Event):void
{
var mc = e.target;
if( mc.over == true )
mc.nextFrame();
else
mc.prevFrame();
}
function change_page(no:Number):void
{
for( var i:Number = 0; i < main_menu.numChildren; i++ )
{
var mc = MovieClip( main_menu.getChildAt(i) );
mc.over = false;
mc.flashmo_click_area.visible = true;
mc.addEventListener( MouseEvent.ROLL_OVER, btn_over );
mc.addEventListener( MouseEvent.ROLL_OUT, btn_out );
mc.addEventListener( MouseEvent.CLICK, btn_click );
}
var mc_selected = MovieClip( main_menu.getChildAt(no) );
mc_selected.over = true;
mc_selected.flashmo_click_area.visible = false;
mc_selected.removeEventListener( MouseEvent.ROLL_OVER, btn_over );
mc_selected.removeEventListener( MouseEvent.ROLL_OUT, btn_out );
mc_selected.removeEventListener( MouseEvent.CLICK, btn_click );
page = no + 1;
play();
}
change_page(0); // default page on load
flashmo_credit.addEventListener( MouseEvent.CLICK, credit_link );
function credit_link(e:MouseEvent):void
{
navigateToURL( new URLRequest( "http://www.flashmo.com" ), "_parent" );
}
/*
var default_volume:Number = 0.60; // 0.00 to 1.00
var bg_music:Sound = new flashmo_music();
var music_channel:SoundChannel = bg_music.play(0, 10000);
var music_volume:SoundTransform = new SoundTransform();
music_volume.volume = default_volume;
music_channel.soundTransform = music_volume;
sound_control.stop();
sound_control.addEventListener( MouseEvent.CLICK, play_pause );
function play_pause(e:MouseEvent):void
{
music_volume.volume = default_volume;
if( e.target.currentFrame == 1 )
music_volume.volume = 0;
music_channel.soundTransform = music_volume;
e.target.play();
}
*/
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|