[SOLVED] Movieclip button active state problem !! Help Please !!

This is a discussion on "[SOLVED] Movieclip button active state problem !! Help Please !!" within the Flash & Multimedia Forum section. This forum, and the thread "[SOLVED] Movieclip button active state problem !! Help Please !! are both part of the Design Your Website category.



Go Back   Webforumz.com > Main Forums > Design Your Website > Flash & Multimedia Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Oct 24th, 2007, 13:16
New Member
Join Date: Oct 2007
Location: India
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
[SOLVED] Movieclip button active state problem !! Help Please !!

Hello all, actually my problem is quite simple and I know that it can be done but I don’t know how to do it and I have asked and googled this many time but no one come up to help me with the simple and exact solution. I don’t know people don’t understand my question or they don’t want to tell the solution “ I am very frustrated, sorry for this long intro of my frustration”.
Ok my problem is that I have a flash navigation swf embedded on html page and the same swf is embedded in three another pages of site as navigation.
The swf contains three movieclip buttons “home” , “services”, “contacts”. If the use click the contacts button then he navigate to contacts.htm and my navigation swf buttons reset to up state ( all of them ). All I want that if a user click the contacts button and navigate to contacts.htm then the contacts button should be disabled and should play the active state.
How on earth I could do that please help me on this .
I have some idea that it can be done by using the JavaScript in html and may be flash vars . Please please please help me out .

The code I am using for my movieclip buttons are :

Code: Select all
 
THome_btn.onRollOver = function() {
THome_btn.gotoAndPlay("over");
};
THome_btn.onRollOut = function() {
THome_btn.gotoAndPlay("out");
};
THome_btn.onRelease = function() {
THome_btn.getURL("index.htm","_self");
};
 
TServices_btn.onRollOver = function() {
TServices _btn.gotoAndPlay("over");
};
TServices _btn.onRollOut = function() {
TServices _btn.gotoAndPlay("out");
};
TServices _btn.onRelease = function() {
TServices _btn.getURL("services.htm","_self");
};
 
TContact_btn.onRollOver = function() {
TContact_btn.gotoAndPlay("over");
};
TContact_btn.onRollOut = function() {
TContact_btn.gotoAndPlay("out");
};
TContact_btn.onRelease = function() {
TContact_btn.getURL("contacts.htm","_self");
};

There is an active state is there as well but I don’t know how do I call that until I have some current page variable for html page .

Last edited by Sgaspar11; Oct 24th, 2007 at 21:41.
Reply With Quote

  #2 (permalink)  
Old Oct 24th, 2007, 21:40
Multimedia Specialist
Join Date: Apr 2007
Location: Arizona
Age: 25
Posts: 666
Blog Entries: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Sgaspar11
Re: Movieclip button active state problem !! Help Please !!

You will definately need to use FlashVars to do this...

Set a value in your embed code that sets the page value to a page name.

Then create some IF statements in your flash file using AS to disable buttons...

Something like:

Code: Select all
 
if(page="home")
{
do whatever
}
Cheers,

Scott
Last Blog Entry: Yay!? (Oct 8th, 2007)
Reply With Quote
  #3 (permalink)  
Old Oct 24th, 2007, 21:47
marSoul's Avatar
Moderator
Join Date: Sep 2007
Location: Tehran - Iran
Age: 28
Posts: 405
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 4 Posts
Send a message via MSN to marSoul Send a message via Yahoo to marSoul
Re: Movieclip button active state problem !! Help Please !!

I really don't understand what you want to do, if you want to disable a button you can use : my_btn.enabled = false;
that will disable your button.
But if you want to communicate with your current page and see what should be done, you should pass variable to swf file with flashvars.
But i don't know what you are looking for... !
If you want describe more briefly
__________________
Designing For Communicating
Website : http://www.datisdesign.com
Weblog : http://blog.datisdesign.com

Last Blog Entry: Throughout IRAN (Dec 10th, 2007)
Reply With Quote
  #4 (permalink)  
Old Oct 25th, 2007, 06:51
New Member
Join Date: Oct 2007
Location: India
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Movieclip button active state problem !! Help Please !!

Thank you Sgaspar11 and marSoul for replying now I have a feeling that I will be able to solve my problem in this forum with you guys.
I have some idea that I have to use FlashVars for this but I don’t know the proper way to do so, can you flash experts show me how do I set the value in my html pages to communicate with my swf navigation, and marSoul I want to brief it for you a bit more and I have also enclosed my project file, please take a look at that and please make necessary changes to it so then I will be able to understand it more, all I want just my buttons to play the active state in the movieclip button on the corresponding page ! Like if a user click on services button and navigate to services.htm then the services button should play the active state of the movieclip button.
Along with this the hyperlink on the button should be disable so user would not be able to click it again on the current page.

I hope this clarify my problem !!

Thank you for help !! appreciated !!

navigation-test.zip
Reply With Quote
  #5 (permalink)  
Old Oct 25th, 2007, 10:50
marSoul's Avatar
Moderator
Join Date: Sep 2007
Location: Tehran - Iran
Age: 28
Posts: 405
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 4 Posts
Send a message via MSN to marSoul Send a message via Yahoo to marSoul
Re: Movieclip button active state problem !! Help Please !!

Hi,
I have attached the modified files,
Here is how it works , you should pass a variable to swf file with FlashVars for object :

Code: Select all
<param name=FlashVars value="whichpage=home" />

and for embed :

Code: Select all
FlashVars="whichpage=home"
and then in ur flash file i put the switch case command :

Code: Select all
switch (whichpage) {
    case "home" :
        THome_btn.gotoAndPlay("active");
        THome_btn.enabled = false;
        break;
    case "services" :
        TServices_btn.gotoAndPlay("active");
        TServices_btn.enabled = false;
        break;
    case "contacts" :
        TContact_btn.gotoAndPlay("active");
        TContact_btn.enabled = false;
        break;
}
Hope these helped you...
Attached Files
File Type: zip navigation-test.zip (17.5 KB, 6 views)
__________________
Designing For Communicating
Website : http://www.datisdesign.com
Weblog : http://blog.datisdesign.com

Last Blog Entry: Throughout IRAN (Dec 10th, 2007)
Reply With Quote
  #6 (permalink)  
Old Oct 25th, 2007, 14:33
New Member
Join Date: Oct 2007
Location: India
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Movieclip button active state problem !! Help Please !!

Thank you Thanks a lot marSoul you are my man !! God bless you !! you have solved my problem in a very easy way I never thought its going to be this simple, though I could not be able to do it myself cause I am not that much of action script guy but you are a flash guru. I am jumping now thanks a lot once again !!

Last edited by alladeen; Oct 25th, 2007 at 14:38.
Reply With Quote
  #7 (permalink)  
Old Oct 25th, 2007, 14:40
marSoul's Avatar
Moderator
Join Date: Sep 2007
Location: Tehran - Iran
Age: 28
Posts: 405
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 4 Posts
Send a message via MSN to marSoul Send a message via Yahoo to marSoul
Re: Movieclip button active state problem !! Help Please !!

you are welcome !
im not a flash guru, still there are lots to know...
anyway if your problem solved please mark ur topic solved
regards
__________________
Designing For Communicating
Website : http://www.datisdesign.com
Weblog : http://blog.datisdesign.com

Last Blog Entry: Throughout IRAN (Dec 10th, 2007)
Reply With Quote
Reply

Thread Tools

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
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to retain the disable state of the button after page refreshing srinivasyadav JavaScript Forum 1 Sep 9th, 2007 14:17
Active State Lchad Web Page Design 10 Jan 27th, 2007 01:29
Button triggering movie state WakeoftheBunT Flash & Multimedia Forum 3 Nov 6th, 2006 13:15
Setting the state of a button using actionscript artdog Flash & Multimedia Forum 6 Oct 18th, 2006 14:45


All times are GMT. The time now is 17:27.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43