Old 05-18-2009   #1 (permalink)
Registered User
 

Join Date: Nov 2007
Posts: 14

Help with Creating An Action That Reveals

Greetings Folks!

I'm looking to do something that seems kinda simple but I'm having loads of trouble doing it. Hoping to get some help from this awesome community.

I want to create flash that when you press the button, the top (moves up) and bottom (moves down) layers of the file will drop revealing content below it.

Something kinda like this page but where the show/hide button actually moves above layers to show content below.

Any help would be greatly appreciated!

Thanks in advance!
Roosta is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 05-18-2009   #2 (permalink)
Registered User
 
agentxi's Avatar
 

Join Date: Oct 2006
Location: Red Deer - ish, Alberta
Posts: 580

hey roosta,

i think you may want to check out this tutorial, it might help explain a bit of what you want done.

kirupa.com - Changing Stacking Order (swapDepth)

hope this helps.
`agentxi`
__________________

when evil is afoot, and you don't have any arms, you've gotta use your head. And when evil is ahead and you're behind, you've gotta do the legwork. But when you can't get a leg up, you gotta be hip. You gotta keep your chin up, and kick some-...
agentxi is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 05-18-2009   #3 (permalink)
Just unleashed!
 
unleash's Avatar
 
Pinboliada Champion! Tournaments Won: 1

Join Date: Jul 2005
Location: Inbetween
Posts: 2,629
Blog Entries: 10
Images: 20

Battle Wins: 1 (rank: #35)
So what you want to do is make an hidden layer that reveals itself when the button is pushed? right?

Do you have any skills in actionscript? Cause what you want to do is this:

When the btn is clicked you want to create an empty movieclip;
Code:
stop();

btn.onRollOver = function() {
	this.createEmptyMovieClip("container",3);
	container.attachMovie("Symbol 2","Menu",3);
	mc._y = 45;
	mc._x = 175;
};
btn.onRollOut = function() {
	mc.removeMovieClip;
};
It should look something like that... this is just something I spew out... so it probably has some bugs left or so... (or it might not be working yet missing parts or something). But I hope this gets you in the right direction!

PS: "btn" is the instance name for the main button and "Symbol 2" is the librabry name for the drop down menu. Of you want it to be animated... than the code should be different... let us know!
__________________
Ads are the cave art of the twentieth century.

That what doesn't destroy us, makes us stronger.

Last edited by unleash; 05-18-2009 at 11:07 PM. Reason: Oops spotted a flaw already!
unleash is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 05-18-2009   #4 (permalink)
Registered User
 

Join Date: Nov 2007
Posts: 14

Thanks for the replies guys.

This is what I used.

animation_mc.stop();
button_mc.stop();

button_mc.onPress=function(){
if(button_mc._currentframe ==1){
this.gotoAndStop(2);
animation_mc.play();
}
else{
this.gotoAndPlay(1);
animation_mc.stop();
}
}

I'm not so good with actionscripts as all. Cant seem to get it to work.

Sorry I posted this another thread. But I attached the file too.
Attached Files
File Type: zip page_temp4.zip (7.3 KB, 3 views)
Roosta is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 05-18-2009   #5 (permalink)
Registered User
 

Join Date: Nov 2007
Posts: 14

So, in the file, what I am trying to so is have the one button show/hide content behind the red gradient box.

Again, any help would be greatly appreciated!

Thanks in advance!
Roosta is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 05-19-2009   #6 (permalink)
Just unleashed!
 
unleash's Avatar
 
Pinboliada Champion! Tournaments Won: 1

Join Date: Jul 2005
Location: Inbetween
Posts: 2,629
Blog Entries: 10
Images: 20

Battle Wins: 1 (rank: #35)
So I was trying to open that file...

But it cant open it It says "unexpected file format"...

so what version of flash are you using?
__________________
Ads are the cave art of the twentieth century.

That what doesn't destroy us, makes us stronger.
unleash is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 05-19-2009   #7 (permalink)
Registered User
 

Join Date: Nov 2007
Posts: 14

sorry cs4. attached new version. Tho I realise that there is a mistake in the make up of it.

I got it to work by changing the the action script to 2.0 but I want to press the button to get the layer to drop and then hit the same button to get the layer to hide the content again.

attached cs3 format.
Attached Files
File Type: zip page_temp4.zip (5.3 KB, 5 views)
Roosta is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 05-19-2009   #8 (permalink)
Just unleashed!
 
unleash's Avatar
 
Pinboliada Champion! Tournaments Won: 1

Join Date: Jul 2005
Location: Inbetween
Posts: 2,629
Blog Entries: 10
Images: 20

Battle Wins: 1 (rank: #35)
euhm, than that means you want to use variables.

you get something like this:

Code:
btn.onPress = function(){
	if(i == 0){
		i++;
		//enter the code that makes the menu drop here//
	}else if(i == 1){
		i = 0;
		//enter the code that makes the menu retract here//
	}else{
		echo "error i has exceeded maximum value";
	}
};
__________________
Ads are the cave art of the twentieth century.

That what doesn't destroy us, makes us stronger.
unleash is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 05-19-2009   #9 (permalink)
Registered User
 

Join Date: Nov 2007
Posts: 14

INteresting. Gonna give this a go... hope it works! You all rawk! Thanks.

Will report back!

Quote:
Originally Posted by unleash View Post
euhm, than that means you want to use variables.

you get something like this:

Code:
btn.onPress = function(){
    if(i == 0){
        i++;
        //enter the code that makes the menu drop here//
    }else if(i == 1){
        i = 0;
        //enter the code that makes the menu retract here//
    }else{
        echo "error i has exceeded maximum value";
    }
};
Roosta is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 05-19-2009   #10 (permalink)
Registered User
 

Join Date: Nov 2007
Posts: 14

Okay,

so if I make two movieclips, one with the layer dropping off the stage and one with the layer coming back to the stage and embed both of them onto the scene, how can I have:

1. one button that drops the layer and also brings the layer back?
2. what is the code to get one button to do 2 things?
3. make it so that the animation for both movie clips stop after running once? Where would I put the stop(); code?

thanks folks!

Quote:
Originally Posted by unleash View Post
euhm, than that means you want to use variables.

you get something like this:

Code:
btn.onPress = function(){
    if(i == 0){
        i++;
        //enter the code that makes the menu drop here//
    }else if(i == 1){
        i = 0;
        //enter the code that makes the menu retract here//
    }else{
        echo "error i has exceeded maximum value";
    }
};
Roosta is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 05-21-2009   #11 (permalink)
Just unleashed!
 
unleash's Avatar
 
Pinboliada Champion! Tournaments Won: 1

Join Date: Jul 2005
Location: Inbetween
Posts: 2,629
Blog Entries: 10
Images: 20

Battle Wins: 1 (rank: #35)
Im not sure what you are asking, but I think this will do the trick of the drop down menu

If you dont understand the code, reply here and Ill try to explain it for you!

The code:

Code:
stop();
i = 0;
btn_home.onPress = function() {
	if (i === 0) {
		dropIn(bbm);
		i++;
	} else {
		dropOut(bbm);
		i = 0;
	}

};
bbm.btn_am.onRollOver = function() {
	bbm.btn_am._alpha = 50;
};
bbm.btn_am.onRollOut = function() {
	bbm.btn_am._alpha = 100;
};


function dropIn(mc) {
	easeType = mx.transitions.easing.Strong.easeInOut;
	var begin = -62;
	var end = 97;
	var time = 10;
	inTween = new mx.transitions.Tween(mc, "_Y", easeType, begin, end, time, false);
}
function dropOut(mc) {
	easeType = mx.transitions.easing.Strong.easeInOut;
	var begin = 97;
	var end = -62;
	var time = 10;
	outTween = new mx.transitions.Tween(mc, "_Y", easeType, begin, end, time, false);
}
I Have attached the file, the file contains a working version. Do note that this is not the only way to do this. There is a cleaner way... which contains listeners and stuff... but I don't think you would be able to use that code yourself
Attached Files
File Type: zip Untitled-1.zip (6.0 KB, 2 views)
__________________
Ads are the cave art of the twentieth century.

That what doesn't destroy us, makes us stronger.
unleash is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 05-21-2009   #12 (permalink)
Registered User
 

Join Date: Nov 2007
Posts: 14

Thanks you SO MUCH! You rawk!

Gonna give it a whirl right now!
Thanks again!

Quote:
Originally Posted by unleash View Post
Im not sure what you are asking, but I think this will do the trick of the drop down menu

If you dont understand the code, reply here and Ill try to explain it for you!

The code:

Code:
stop();
i = 0;
btn_home.onPress = function() {
    if (i === 0) {
        dropIn(bbm);
        i++;
    } else {
        dropOut(bbm);
        i = 0;
    }

};
bbm.btn_am.onRollOver = function() {
    bbm.btn_am._alpha = 50;
};
bbm.btn_am.onRollOut = function() {
    bbm.btn_am._alpha = 100;
};


function dropIn(mc) {
    easeType = mx.transitions.easing.Strong.easeInOut;
    var begin = -62;
    var end = 97;
    var time = 10;
    inTween = new mx.transitions.Tween(mc, "_Y", easeType, begin, end, time, false);
}
function dropOut(mc) {
    easeType = mx.transitions.easing.Strong.easeInOut;
    var begin = 97;
    var end = -62;
    var time = 10;
    outTween = new mx.transitions.Tween(mc, "_Y", easeType, begin, end, time, false);
}
I Have attached the file, the file contains a working version. Do note that this is not the only way to do this. There is a cleaner way... which contains listeners and stuff... but I don't think you would be able to use that code yourself
Roosta is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 05-21-2009   #13 (permalink)
Registered User
 

Join Date: Nov 2007
Posts: 14

Unleash! You are my fave person in the world!

It's perfect! Thank you SO SO MUCH!
Roosta is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 05-21-2009   #14 (permalink)
Just unleashed!
 
unleash's Avatar
 
Pinboliada Champion! Tournaments Won: 1

Join Date: Jul 2005
Location: Inbetween
Posts: 2,629
Blog Entries: 10
Images: 20

Battle Wins: 1 (rank: #35)
no thanks

Let me know how your ?site? looks in the end! Im kinda curious now!
__________________
Ads are the cave art of the twentieth century.

That what doesn't destroy us, makes us stronger.
unleash is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 05-21-2009   #15 (permalink)
Registered User
 

Join Date: Nov 2007
Posts: 14

Smile

Dude are you AWESOME!

Social Justice Leadership: Mission & Vision

I changed it up a bit to make it bigger.

Question:
Is there a way to have the read button change to close when the layer drops in and then back to read when the layer drops out?

I was gonna try that but was too scared to mess the whole thing up! Def aint got the skills you rocking for sure!

Thanks so much again!

Quote:
Originally Posted by unleash View Post
no thanks

Let me know how your ?site? looks in the end! Im kinda curious now!
Roosta is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Tags
actionscrip, drop down menu, easing, flash

Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Vectored Art Action Duane Heaton Illustration, Sketching & Vector Art 1 02-22-2008 04:59 AM
Action mary Adobe Photoshop 1 11-12-2007 08:27 AM
action sets fatih Adobe Photoshop 1 04-13-2007 12:23 AM
Action? tcarlitagraphic Adobe Photoshop 3 08-21-2006 12:06 AM
Action help Andantonius Adobe Photoshop 3 04-26-2006 07:23 PM


All times are GMT +1. The time now is 06:47 AM.

Powered by vBulletin Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.2

Design & Content © BioRUST 2008 :: PRIVACY STATEMENT :: LEGAL INFORMATION :: ADVERTISING MEDIA KIT