Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Having A Button Do Two Things?



Keeping this very brief and simple (as it no doubt requires a simple and brief solution) - this is what I want to happen:

A user to click on a button on my splash page, and then for it to popup a window/fullscreen of my main site..and for the original splash page to change to an exit / relaunch graphic as seen on many sites.

Obviously I have taken care of the popup, centered it, etc. no problem - but I am having trouble having the button in flash execute 2 commands (change the main/parent page AS WELL as do the popup). I can only seem to get one or the other to work..

Is there some kind of javascript I can put in the html to make the original page change to a new one?

Please help..thanks in advance!!

Eric



FlashKit > Flash Help > Flash ActionScript
Posted on: 10-24-2004, 02:07 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Button To Do 2 Things?
Hi im not sure what is going wrong. But basically i have 3 scenes to a movie. On the first scene i have an animation that is shown which makes the page look like its being built. I want to be able to press a button, which then goes to another frame on the same scene which plays the animation backwards, then loads the other scene. However i can only get the button to do one or another.

on (release) {
gotoAndPlay(36);
gotoAndPlay("clients", 1);
}


This is what i was trying to use, to do this. Have you any ideas..

THanks Alex

Want Other Things To Appear When On Button
So I've got this button.
And when you move over the top of it, it changes appearance, which is good.
It's going to play video eventually. So, I want some video stills to appear when you put the mouse over the button.
Essentially, I want a graphic to appear when someone's over the button.

I totally new to this program. I mean, totally.

Getting A Button To Do 2 Things
Getting a button to do 2 things

im trying to get my button to play a sequence. for example i need the play head to play from frame 1 till 10 then play from 15 to 20 in one action. (I have used frame labales instead of numbers) I thought there would be a simple action sript command like "and" or "and then" to link the 2 play commands but i couldnt find one.

Any ideas.

Much appreciated

Tab Button + Different Things
Hey guys.

well i have it set up that when the user presses the tab button 4 mc's i have play a fade in animation and then goto a frame in there timeline with a stop action.
But that works but when the user presses tab while they are on the frame with the stop action is just plays the same animation again and i dont want it to do that i want it to goto another frame in the mc's timeline.

var keyListener:Object = new Object();
keyListener.onKeyDown = function() {
if(Key.getCode()== Key.TAB) {
frame_mc.gotoAndPlay("_dissapearing")
login_mc.gotoAndPlay("_appearing")
border1_mc.gotoAndPlay("_change")
borderpart2_mc.gotoAndPlay("_appearing")
backbutt_mc.gotoAndPlay("_appear")
}
};
Key.addListener(keyListener);

var keyListener:Object = new Object();
keyListener.onKeyDown = function() {
if (Key.getCode()== Key.TAB) {
frame_mc.gotoAndPlay("_reapear")
login_mc.gotoAndPlay("_dissapear")
border1_mc.gotoAndPlay("_foldingback")
borderpart2_mc.gotoAndPlay("_changingagain")
backbutt_mc.gotoAndPlay("_invisible")
}
};
Key.addListener(keyListener);

thats the code i have above so what im asking is where or how would i tell it that if the user presses tab again while there on the frame with a stop action that it goto's and plays another frame of i.

dou get it?
im on msn now if u didnt understand what im after so hope u can help

Getting One Button To Perform Two Things
I have a button simulating the button on a remote control. When the user moves the mouse cursor over that button, I want it to go to frame 1 of a new scene and when the mouse cursor is moved away it goes back to the current scene (which is frame 24 of a scene called 'selections').

This I have tried and it works with the following code:

on (rollOver) {
gotoAndPlay ("contact", 1);
}

(also frame 1 of the scene 'contact' simply has a stop action on it)

I also want to make it that if you were to click on that same button, it would take you to a different scene called 'email'.

This I have tried and it works with the following code:

on (release) {
gotoAndPlay ("email", 1);
}

However, if I try to combine both actions on the one button with the following code:

on (rollOver) {
gotoAndPlay ("contact", 1);
}
on (release) {
gotoAndPlay ("email", 1);
}


only the rollover parts works fine, clicking on the button then does nothing

Please share some of your genius with me

thanks

Assign Two Things To A Button
HOw do i assign two things to a button? I want to make it so that if on roll out it goes to frame 1 and if on release it goes to and stays frame 5. THanks for any help.

Same Keyboard Button Does Different Things
Here is what I need the code for:

if "F1" is pressed then the "0" key goes to and stops at frame 2.

if "F2" is pressed then the "0" key goes to and stops at frame 3.

if "F3" is pressed then the "0" key goes to and stops at frame 4.

Idealistacally, the F1, F2, and F3 keys would only have to be pressed once and not held down in order to change the actions of the "0" key.

If anyone knows how to code this, I would be very appreciative, because I am awful at action scripting!

Button And Frame Things
Sorry I'm posting in random, but I want a quick answer. How do you make a button, to where you press it, it plays a different frame from inside a defferent movie clip? Where that button is outside that movie clip.

Thanks
G/B

Tracking One Button And Doing Many Things With It.
I am trying to get a single instance of button(mc) to do a check to see what a (var total) is on and if 1,2 or 3 I want it to reload with new items. Can someone point me somewhere for direction? Thanks,

MT

Button And Frame Things
Sorry I'm posting in random, but I want a quick answer. How do you make a button, to where you press it, it plays a different frame from inside a defferent movie clip? Where that button is outside that movie clip.

Thanks
G/B

How To Make A Button That Does Two Things?
I'm trying to make a button that first tells a swf file externaly loaded into the flash page to go to and play at frame 50 and then when that is done load another external swf in the same box as the previous one was in.

How can I do it?

Button Question. Two Things
Anyone know how I can make a button do both of these?
Do something when the user clicks it, and do the same thing when the user hits enter. Thanks

Does It Make Things Easier To Plan Things Out Before Programming?
I know this may seem like a stupid question, but as a Actionscript beginner i'd like to know if its easier to plan things out before hand. Basically i've got to make a Class that does the following:

- Creates a shape with a size and colour defined by values passed through the constructor
- the initial position of the shape should be passed to the constructor
- the horizontal vertical speed should be passed to the constructor
- the initial direction (up or down) should be passed through to the constructor
- the shape should reverse direction on "impact" with the stage top and bottom.


Now i want to make the thing itself, but i think im going to struggle. unless i make a really decent plan of the class. so can anybody recommend what the best way to plan out this is?

if anyone can help, i'd appreciate it - if not, no worries.

HOW DO I MAKE A BUTTON DO DIFFERENT THINGS IN DIFFERENT PLACES?
Okay, i have this button, which, when the mouse hovers over it, changes color. except, i use it with two different backgrounds. Is there any way i can use two different mouse over colors using the same buttons, or do i have to make a new button for each background?

A Button With Things Going On Inside The Text.
Hello. Hi I have a question. I have a button... I want when the mouse goes over the button it animates sumthing inside it. For emample go here and check out the button.
http://www.clantsw.cjb.net/ look at the button at the end of the intro? can u give me a turtoil of that or tell me how to??? Thx

Jake

Can You Click Twice On A Button/movie & Do Two Different Things?
Hi,

Is it possible to have a button or movie clip do one thing when it is clicked then do another thing if it is clicked a second time.

I guess, this would be useful if you needed to click to reveal something then click again to make it go away. A menu sliding out then sliding away again.

How would you do this?

thanks.

Julain

[F8] How Do I Get Things To Follow Things?
I'm trying to get the enemy follow what you control in an overhead game and my current actionscirpt is...

onClipEvent(enterFrame){
function locate(uuuxe) { //function name is locate()
xd=this._x-_root.uuuxe._x //the difference in-between this symbol's x and the other symbol's
yd=this._y-_root.uuuxe._y
npx=(xd+yd)/Math.pow(2,1/2)
npy=(yd-xd)/Math.pow(2,1/2)
if(npx>=0 && npy>=0) {
this._rotation=0
this._y-=2.5
return 1
} else if(npx>=0 && npy<=0) {
this._rotation=270
this._x-=2.5
return 2
} else if(npx<=0 && npy>=0) {
this._rotation=90
this._x+=2.5
return 4
} else {
this._y+=2.5
this._rotation=180
return 3
}
}
}

What am I doing wrong? Thanks!!

FlashNoobXanthus

2 Things
How do u do an equalizer for the music on your website?
and what is defaultapp.exe and where can u get it?

Help With A Few Things, Please
I have a few questions.

1) When I have a mc that is a width of about 2500 pixels or longer, how do I edit it when I can't see the entire thing? I tried to reduce it and move it around, but either way I am not able to get to the beginning or end of it. Also it will not allow me to change the info prameters if it is over a certain size.

2) Can someone take a look at this site I am working on.
http://www.heisourlife.com/bettale
There are probably a few things I need to change with the code, but I need some help. Right now the images, timeline, and everything else is in its own mc. I think the only thing that should be in a mc are the images. Is this correct? Also, the timeline from 1950 - Present should stay in place, that is 1950 should remain at the left of the black box and Present should go to the far right side. The little box should move along that line. This is where I need help. I think it is rather obvious when you look at it. Sorry no preloader right now. It might take about 45 sec to load on 56k.

Thanks for your help
jhb

How Do I Do These Things..?
Hi All,

I really like this nav menu and image slide/blur effect.

http://www.lightray.com/flash/index.html

How the hell would i do it...is there any good tutorials available for each.

I have a book coming in the mail on flash MX, until then all i have is you guys....

Thanks alot

dvdvault

PS: I imagine ill be using this forum LONG after the new book has been absorbed

One Of These Things Is Just Like The Other?
Hi
In relation to using color.setTransform could someone clear up one point of confusion for me.
What is the difference between these two items, they seem to be the same thing expressed in a different numerical style? I have always wondered about this in the "advanced" tab of the effect panel as well. This is copied from the flash help....

ra is the percentage for the red component (-100 to 100).
rb is the offset for the red component (-255 to 255).


oh and why is it possible to set a negative percentage and offset. I would have thought 100% or no red was the logical limits? OK thats two points I know ;-)
thanks mark

You Know Those Things...
You know on Macromedia.com's pages for product info...

Those menus that when you click on them have a menu drop down below them, and all the other headers drop down below the sub-headings?

W3bdevil

A Few Things I Need To Ask
Okay, i have just a few questions,
i learn a musical instrument, and my teacher says i need a metronome.

How do i make it? i would like to know how to set up the script to make the pendulm swing, also how to set up the tick sound to work when the wsing hits a certain place and how to display a slide which allows you to control the speed fo the metronome

if you could help me it would be very appricated

thanx

What Are The First Things You Need To Know First?
If I wanna create a game using flash. What do I need to know how to use. What program do you use to make games anyways?

If I wanna create a cartoon animation. Do I use Macromedia Flash MX? What are the main things you need to know in order to create a flash cartoon animation.

Could Anyone Help Me With Some Things?
Hi I was wondering if anyone who is good with actionscripting could help me out a bit cause i want to make a flash but its going to require lots and lots of actionscripting, i am reading up on how to do things but i wanted an expert to help me understand a little better about this stuff and maybe teach me a bit of it so any help would be great, thanks in advance. -Ziggster

First Things First...
first of all, "instence1" is the default name fkash gives to MC's, just for your convinence make a name for that MC. lets say you called it "myClip". if myClip reside on the main time line, the best way to reffer to it from anywhere in the movie is: _root.myClip.downtrigger
got me?
good luck.

2 Little Things
Yasmin Alhilli

I need a little help on 2 things please.

1. if you view the photo gallery, you will see an arrow - allowing the user to "scroll" to the next set of pics, when the next set of pics is displayed, there is another arrow, taking the user back to the first set - I can't get this button to work, how do I do it?

I want the MC to play in reverse order, back to the first frame when this button is clicked, please help.

2. this movie is made for 1024x768 resolution, how can I make it shrinkable, so that it fits on a 800x600 screen too?

thanks in advance guys

Tried Many Things... Help
I am making a build your own snowman game and I am having trouble with the script. I have all the pieces on the stage but I want to be able to click a hat and it duplicates and drags on the same click. I have that to work but I want to be able to do this as many times need, I can only get 2 at once then when you go for the third one disappears.

heres an example...

http://www.flasharcade.com/game.cgi?christmastree


Thanks in advance,

First Things First
Hi,

I'm totally new to Flash and what i would really like to know first is; What are the visual media handling capabilities and limitations of Flash?

Thank You

3 Things I Can't Fix
I've been making this site for awhile, but there are some things I can't figure out.

the FLA is at
http://www.tcurranmusic.com/work/20.fla

the SWF is at
http://www.tcurranmusic.com/work/20.swf

Problem 1:
When going from page to page, I can't seem to get the scroll to set to 0 withough briefly showing the currently loaded text "jump" up to the top. I'd like the current text to fade out, the new text to load, reset to 0 scroll, then fade in.

Problem 2:
I've tried setting a variable for the mute button on the first page, but have failed. I want the button to "remember" the user's setting so that when they come back to the home page the mute button would be on and no music would play. I'm not talking about a cookie thing, just on the same visit to the site it would remember.

Problem 3:
My nav buttons all have their own sounds. I would like for each of them to "stop all sounds" except the loop that's playing on the home page. Rught now they bleed into eah other and it sounds like a mess.

Please, any help is appreciated, I'm ALMOST done with this thing!

-spack

Things I Need To Know.
Ok i have just entered the Animation part of Flash5 and there are a few questions i have. I created one movie so far, http://www.sfdt.com/flash/movies/7696.html, its decent I guess. But I feel like im missing the whole concept of animating. So let me ask a few questions that i need to know.

1) How do I get animation time to match real time? What I mean is I am having problems with matching, for example, the speed i am animating a character to walk compared to the speed of a normal person walking in real life. Understand?

2) How do I ANIMATE a character to walk? I am having the hardest time with this. Is there a plug in, prefferably free, of bones to add to a character? Sort of like Bones in 3d programs.

3) How do I copy and paste frames properly?

4) How do I animate Properly? I currently animate like this. I give each Character a new Layer for each body part: Head, Body, Left arm, Right arm, Left leg, Right leg. This is because when i have to instances on a layer in motion tween, it combines the two together messing it all up. But Creating a complex scene with 3 or more characters would take up many frames, so is that how its suppose to be? I also animate very tedious, such as animating 7 out of 10 keyframes sometimes. This is because ShapeTweening of lines flips the line when you cross two end points. Is there a way to stop that, because at the rate im going it will take me forever.

5) Can I create GOOD animations without having to use Scripting? Id really like to not have to get into scripting just to create good animations. Are the 3D animations i see made with scripting? If so can i get some good links on good scripting for animating? not for like webpage stuff, jut animation.

Thank you for your help.

A Few Things
Hi guys. I have a few questions regarding Flash actionscript.

First: Does the "go to next scene function" on a button only work if it places on the scene 1 stage?
(because i have tried once which i have put a button that contains that action in a movie clip, but when i view the movie, the button doesnt work. i need the button to be inside the mc but not on the stage)

Second: Instead of having horizontal and vertical kind of volume slider, can it be done in any other way?
(say......a C shape slider, or L shape...etc...as long as it is not vertical or horizontal)

and the last: Where can i find a tutorial on how to create a dj turntable?

Thanks guys

2 Things..
hi

how do i script a nav button to play the rest of the currently loaded movie and then load another into the main movies level 1...

also how do i create a slider... it doent have to change anything... just move...

cheers

2 Things...
hi

how do i script a nav button to play the rest of the current movie and then load another into the main movie with loadmovie or another scene,

you see i want an animation when comming into the scene and an animation leaving the scene, then goto the scene that the button was pressed for..

also how do i create a slider... it doent have to change anything... just move...

cheers

Help On A Few Things
ok
firstly,
how do you make a masking circle follow the mouse? do i just do the action script that makes the mouse hide and shows the masking?

secondly,
in swift 3d im having heaps of troube with this program!!! how can i make a background that has a door that you can walk through and then like another room inside. like the effect on xiao xiao 4 the game where the person walks around and then he goes into rooms to shoot people. i wanna know how to make something more simpler but like that!

lastly,
thanx for your help!!!!!!!!!

-reece

Help 2 Things....
Hi!

I have to ask 2 things today.

1) is there a way u can put html and use it thru flash?
2) Can someone help me make a login window...where username and password is required (just pw is ok) and if they/it are/is correct it links you to another web page.

I know how to do that with HTML and JaVa scripts but not flash...problem is my site is flash and i just dont want to make it really ugly by goin to another page and puttin the script there and then logging in.

Dream come true is goin to be UserN Password right on the web site just like with PHP!

Help Thnx...

2 Things...
how do i make a button stay a certain color or shape once a viewer has clicked on it, to show which buttons have already been pushed, and second how can i make my head in my site http://www.xscapeproductions.com/index1.htm spin back to whatever section the viwer choses, rather then start at the begginning everytime. i dont know if i being clear, on that question or not, hehe, i want my head to reverse back or go forward to every section, i dont want it to start at the beginning everytime, just not sure if there is an action to do that...........THNX




_Sean

2 Things
First: Im trying to create a flash sniffer, if the person does not have flash installed i would like to show a pic rather then thew animation, telling them to get flash!!

Second: I would like some kind of script that would randomly load flash animations into a website. I have 6 flash animations, the customer would like to load them randomly, whenever the person visits the site again and again they will get a different animation
everytime!!



Thnx in advance


sean

Ive Tried......many Things
i am having such a problem getting a simple form to work.....

i have read many forums and tried several scripts.

is there anyway that someone can look at my file and tell me what the heck i am doing wrong?

i have no hair left...ive pulled it all out...

i am wondering at this point if it is my server? i use powweb, i have uploaded a php file, etc.

i just want to be able to have visitors enter in their email in the field, click submit, have the field clear and be sent an email that says they have joined an email list (with their email obviously).

ugh......

thanks in advance!

Having Things Go By...
I am making a movie and I am wanting to do like a space travel theme and I want to make it where it seems like you are moving forward. How can I do this? I have tried looking it up and nothing has helped me yet. Anyone know?
thanks,
Dillon Millsap

When And How To Use These Things []
I have some code im tryign to get to work usign a loop. Im not sure how to lay it out to get it to do what im trying to do with these brackets []


Code:
function loadclips() {
for (i=0; i<RecCount; i++) {
//How do I lay this out to append the i to the movie clips
this.p1.two.attachMovie("casebutton", "casebuttond"+i+"_mc", this.getNextHighestDepth(), {_x:xposition, _y:yposition});
//How do I lay this out to append the i to the movie clips
this["p1.two.casebuttond"+i+"_mc"].caseouterbtn_mc.casename = cases[i];
yposition = yposition +50
}
}

[F8] 2 Things
I need to know these 2 things:

-How to make walls

-How to make a side scroll on the y axis so that it goes u and down not left and right

2 Things
The site is here:

http://bartolomy.com/test/index.html

I would like to have it centrered, whatever I try in the html or wherever it wont do it.....


Secondly I seem to have "lost" the preloader, something I did not know until I went semi-live....as on the local hdd the pre loader is non existent...

the source files are attached, if u need anything else then plz lemme now


Plz if you can help then I would appreciate this BIG TIME

Thanks a lot.

B

Two Things
i have made this widget that looks has a refrigerator background and i have made letters and i can drag them around and write words.

first issue: i would like to put this on my mysace page, but i would like it to be able to save from sessioin to session.

second issue: i would also like people to be able to reset the letters to their original state on the fridge.

can someone help me out? thanks!

Are These Two Things Possible?
Is it possible to:

A. Get a property that returns the current path of the SWF?
B. Change the current path used by the loadmovie function? (without prepending anything to the argument)

If yes, how?!?

Thanks!

Two Little Things...Hopefully:)
First off i'm getting a error with this.onEnterFrame code did this change to something better or what ?

Secondly, I'm still trying to find a way in action script 3 to make a button in flash to close the pop up window that the SWF is nested within?

Here is the code for AS2


Code:
exitbut.onPress = function(){
getURL("javascript:parent.close()");
};
Can anyone help me out Thanks in advance!!!

Two Things:
The first of the two problems (more of a lack of creativity than problem) I'm having is with my scrollbar:

I have a scrollbar that works when scrolling a movieclip of a fixed length. Unfortunatly, what I wish to scroll is a dynamic text field whose length will vary. I can get it to work with simple scroll buttons, but i really like the whole bar thing.
I am trying to keep the website as dynamic as possible, so i need the scrollbar to just figure out how long the external text file is and go from there. Is this possible, or am i just going to have to find another way of doing this. The code i have currently is a bit too long to post, if anyone has some time they'd like to waste on me then i would gladly send it to you.

Next problem:
I have an empty movie clip on the stage that is a certain size, a size i want. I am importing into it a picture that is considerably larger than that certain size. I wish to resize the aforementioned picture so that it the size of the movie clip prior to the loading of the external image. I have tried to do this two different ways (both of which you can see at the bottom of the message) and no, i don't run them at the same time.
In the code, flyerLoader_mc is the movieclip that i am loading the image into, "flyer/1.jpg" is the the image, and extBar_mc is my preloader bar. Both sets of code are probably not working for the same reason, i just can't figure the reason, or more importantly, a way to fix it.

Thanks a lot for even reading this collossal post.
Any help will be greatly appreciated.

-Sean









Attach Code

// THE FIRST WAY \
flyerLoader_mc.loadMovie("flyers/1.jpg",flyerLoader_mc);

var myInterval:Number = setInterval (flyerLoad, 10);

function flyerLoad() {
var current = flyerLoader_mc.getBytesLoaded();
var total = flyerLoader_mc.getBytesTotal();
var getpctLoaded:Number = Math.round((current/total)*100);
extBar_mc._xscale = getpctLoaded;
if(current >= total){
//resize it
flyerLoader_mc._width = 205;
flyerLoader_mc._height = 314.9;

clearInterval (myInterval);}
extBar_mc._visible = false;
}

//THE SECOND WAY\
var flyerLoader:MovieClipLoader = new MovieClipLoader();
var flyerListener:Object = new Object();
flyerLoader.addListener(flyerListener);

flyerLoader.loadClip("flyers/1.jpg",flyerLoader_mc);

flyerListener.onLoadProgress = function(flyerLoader_mc:MovieClip,bytesLoaded,bytesTotal) {
var pctLoaded:Number = Math.round(bytesLoaded/bytesTotal*100);
extBar_mc._visible = true;
extBar_mc._xscale = pctLoaded;

if (bytesLoaded >= bytesTotal){
extBar_mc._visible = false;
//resize it
flyerLoader_mc._width = 205;
flyerLoader_mc._height = 314.9;
}
}

How To Put Things Together
I'm new to Flash/AS3. I am reading books that are teaching coding syntax. All this is good to the point where I would want to try a sample of code. That is where I have a problem and any of the books doesn’t explain how to set up the environment. Should I create a project first? How to set the root folder where the top package will reside? How to make all your custom classes visible in relation to that root folder. If I have any external objects like movie clips or drawing where they suppose to be saved at? Can anyone advise me how should I put everything together?

These Things
hey i was wonderingif you guys knew how they create these graphics...its at this site on the bottom right...the grey withthe lines...i keep seeing these as like backgrounds and im wondering if how they make them...isit photoshop?

heres the link.. www.harvest.org

Copyright © 2005-08 www.BigResource.com, All rights reserved