thanks
i would of posted earlier but my internet conection went wrong
Printable View
thanks
i would of posted earlier but my internet conection went wrong
hi
ive heard that theres some kind of code or something that self activates the flash when you've put it on the internet instead of this anoying message saying "click or press enter to activate"
if this is true could you tell me
check out this site for the fix.
http://www.kirupa.com/developer/flash8/flash_fix.htm
cheers for that
hello again
please could you tell me what code says to play a certain frame
gotoAndPlay(20);
but you should always make it a habbit to give your frames labels so if you want it to play frame 20 then you should give frame 20 an identifying label of whatever it is to play then point the gotoAndPlay to the label.
gotoAndPlay("label");
cheers
Great information. Thank you. One quick question I have is if I wanted to load external swf's into the movie clip container instead of movieclips and have it function the same way, how would the actionscript differ?
Thanks.
not sure I follow exactly what you want. What section of the code are you referring to specifically?
hi
its me again
please could you tell me how to make a button make a different button stick in another movieclip, this is sticking by your code
thanks
well you could modify the code i sent before. you would still call the stick function to do it but instead of using stick(this) you would place the name of the target button you are trying to control. stick(newMovie.buttonToStick);
thanks again for the help
hI VI Knight, i dont know if your still about on here but i have read through your code on here and tried to recreate it within my own flash document.
the code i have added is in regards to another button instance. (about2_mc)
stop();
// create variable to track current page for button states
var currentPage;
//create holder for content
this.createEmptyMovieClip("holder_mc", this.getNextHighestDepth());
holder_mc._x = Stage.width/2;
holder_mc._y = Stage.height/2;
//*** Assign Button States ***
home_mc.onRollOver = function() {
rollover(this);
}
home_mc.onRollOut = function() {
rollout(this);
}
about_mc.onRollOver = function() {
rollover(this);
}
about_mc.onRollOut = function() {
rollout(this);
}
about2_mc.onRollOver = function() {
rollover(this);
}
about2_mc.onRollOut = function() {
rollout(this);
}
portfolio_mc.onRollOver = function() {
rollover(this);
}
portfolio_mc.onRollOut = function() {
rollout(this);
}
contact_mc.onRollOver = function() {
rollover(this);
}
contact_mc.onRollOut = function() {
rollout(this);
}
home_mc.onRelease = function() {
loadContent("home_mc");
stick(this);
}
about_mc.onRelease = function() {
loadContent("about_mc");
stick(this);
}
about2_mc.onRelease = function() {
loadContent("about2_mc");
stick(this);
}
portfolio_mc.onRelease = function() {
loadContent("portfolio_mc");
stick(this);
}
contact_mc.onRelease = function() {
loadContent("contact_mc");
stick(this);
}
//*** BUTTON FUNCTIONS ***
function rollover(movieName){
if (currentPage != movieName){
eval(movieName).gotoAndPlay("over");
}
}
function rollout(movieName){
if (currentPage != movieName){
movieName.gotoAndPlay("out");
}
}
function stick(movieName){
if (currentPage != movieName){
currentPage.gotoAndPlay("out");
}
currentPage = movieName;
currentPage.gotoAndStop("down");
}
function loadContent(movieName){
holder_mc.attachMovie(movieName, movieName ,1);
}
It all looks like it should work but it doesnt. The problem comes when it tried to load up the about2_mc movie file from the library, it just doesnt! it loads the about_mc movie fine, but not the about2_mc movie, it seems very strange to me and its starting to get on my nerves lol.
I have given the button tag the right name & i have kept the movie clip the same name as the tag. it just wont play.
Can you help?
did you tell the movie in the library to export itself for actionscript and give it an instance name to be reference in the library? This sounds like what your problem is.
1. Right click about2_mc in the library and choose linkage
2. Click the export for actionscript checkbox.
3. In the identifier text box make sure it says about2_mc (should be default)
4. click ok. This should make it work.
if you still have problems let me know.
thats brilliant, thanks VI Knight!
Happy new year dude.
just wondering what the code would look like if this code were put into an array? Is it fairly easy to do? Thanks.
which code would that be? If you are referring to the code onthe buttons then no. It won't work in an array. you can do it in a for loop but the name of the buttons would have to be of such that it would take incrementing numbers but other than that no array for coding.
i'm just wondering how to make the code simpler so if I had, let's say, 10 buttons on the stage named but1 - but10, what would be the best way to simplify the code so that I wouldn't have to rewrite the code for each button. Thank you so much for your help.
try this. You will need to keep the function section
Code:var maxButtons = 10;
for(i=1; i<maxButtons +1; i++){
this["but"+i].onRollover = function(){
rollover(this);
}
this["but"+i].onRollOut = function(){
rollout(this);
}
this["but"+i].onRelease = function(){
loadContent(this);
stick(this);
}
}
Great! I really appreciate your help!