Editing A Function For Buttons...
I have the following function, basically a whole lot of ohter things happens onRollOver and onRollOut but pretty sure it's here I need to edit. I have 5 mc's on the stage called 'btn1', 'btn2' etc... And this code...
Code:
numOfBtn = 5;
for (i=0; i<numOfBtn+1; i++) {
_root.buttonsHome["btn"+i].num = i;
_root.buttonsHome["btn"+i].originalY = _root.buttonsHome["btn"+i]._y; //stores original position
_root.buttonsHome["btn"+i].onRelease = function() {
//set the frameNum variable to the same as the number button you selected, i use it again in frame 9
frameNum = this.num;
trace("playhead should be sent to "+frameNum+" by btn"+this.num);
//start playing the movie
play();
};
As I said there is other bits and pieces that happen, but what i want to achieve is btn2, is actually just going to an external link, but at the moment I don't want it when pressed to play... Is there anyway to keep it as part of the function, but if btn2 is pressed NOT to play? Any help would be greatly apprecaited!
KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 08-15-2007, 12:47 AM
View Complete Forum Thread with Replies
Sponsored Links:
Editing A Function For Buttons...
I have the following function, basically a whole lot of ohter things happens onRollOver and onRollOut but pretty sure it's here I need to edit. I have 5 mc's on the stage called 'btn1', 'btn2' etc... And this code...
Code:
numOfBtn = 5;
for (i=0; i<numOfBtn+1; i++) {
_root.buttonsHome["btn"+i].num = i;
_root.buttonsHome["btn"+i].originalY = _root.buttonsHome["btn"+i]._y; //stores original position
_root.buttonsHome["btn"+i].onRelease = function() {
//set the frameNum variable to the same as the number button you selected, i use it again in frame 9
frameNum = this.num;
trace("playhead should be sent to "+frameNum+" by btn"+this.num);
//start playing the movie
play();
};
As I said there is other bits and pieces that happen, but what i want to achieve is btn2, is actually just going to an external link, but at the moment I don't want it when pressed to play... Is there anyway to keep it as part of the function, but if btn2 is pressed NOT to play? Any help would be greatly apprecaited!
View Replies !
View Related
Editing A Function For Buttons...
I have the following function, basically a whole lot of ohter things happens onRollOver and onRollOut but pretty sure it's here I need to edit. I have 5 mc's on the stage called 'btn1', 'btn2' etc... And this code...
Code:
numOfBtn = 5;
for (i=0; i<numOfBtn+1; i++) {
_root.buttonsHome["btn"+i].num = i;
_root.buttonsHome["btn"+i].originalY = _root.buttonsHome["btn"+i]._y; //stores original position
_root.buttonsHome["btn"+i].onRelease = function() {
//set the frameNum variable to the same as the number button you selected, i use it again in frame 9
frameNum = this.num;
trace("playhead should be sent to "+frameNum+" by btn"+this.num);
//start playing the movie
play();
};
As I said there is other bits and pieces that happen, but what i want to achieve is btn2, is actually just going to an external link, but at the moment I don't want it when pressed to play... Is there anyway to keep it as part of the function, but if btn2 is pressed NOT to play? Any help would be greatly apprecaited!
View Replies !
View Related
Image With Editing Function
Link for the website
i would like to create a flash with the function like in the website (refer to link).
in that website, as what i see there is a static template and a dragable image.
i'm new to flash. can anyone simply tell me how the flash is being created...or concept....
and, is it the static template and the dragable is an image too?
View Replies !
View Related
Editing Copied Buttons
I have made one button and made copies of the same button 5 times to form 6 buttons total that look exactly alike. There is one problem. Whenver i try to make one change to one button they all change. I tried the Break Apart option, but then my button goes back to a regular graphic. Is there anyway to edit these buttons without going through each one and breaking them apart and making them all buttons again?Please help......
View Replies !
View Related
Help With Editing Buttons In Flash
I have dreamweaver 8 and flash 8 and i need to add content to the nav bar that was made in flash 8....when i do edit and export back to dreamweaver it doesn't acknowledge the change even when i refresh....or close the program and manually take out the files....what am i doing wrong???
undesirable#1
View Replies !
View Related
Editing Template Monster Buttons - Help
http://www.adelaidemustangs.com.au/header.swf
http://www.adelaidemustangs.com.au/header.fla
http://www.adelaidemustangs.com.au/flashzip.zip
Basically i am trying to find out how i make these buttons active - i tried applying this code:
on (release) {
getURL("index.htm");
}
However it won't work and the button simply stops working! Hoping someone nice with flash can help!
Regards,
Edited: 07/24/2007 at 06:37:57 AM by mastacraft
View Replies !
View Related
Editing Template Monster Buttons - Help
http://www.mastacraft.com/downloads - the files: header.fla header.swf
http://www.mastacraft.com/downloads/header.fla
http://www.mastacraft.com/downloads/header.swf
Basically i am trying to find out how i make these buttons active - i tried applying this code:
on (release) {
getURL("index.htm");
}
However it won't work and the button simply stops working! Hoping someone nice with flash can help!
Regards,
View Replies !
View Related
Editing JPG's In Flash, Mouseovers, Buttons
Hello there,
This is probably a simple question for all computer whiz’s, but I’ve only had Flash MX for a couple of weeks and have got myself totally stuck…
Is it possible to edit a JPG image in Flash MX, if so, how?
What I have done is created an image in Photoshop which I wish to use as a menu bar, but I’d like to have certain sections change color when a mouse passes over it (i.e. one single image with one bit saying ‘News’ another saying ‘Reviews’ etc etc all as one image).
But in the button editing section (where the timeline appears as Up, Over, Down and Hit) I am unable to 'fill' the background area that I wish to change when a mouse passes over it. I can change the area around the image, but not the image.
Why is this and how can I edit the image?
Why cant I just ‘fill’ the background area of a section when I’m in the ‘Over’ section of the timeline so that it appears as a mouse over?
…Hope the above makes sense…???
Any response would be welcome, please remember I’ve only had this for a couple of weeks, so please keep responses as simple and as much in ‘English’ as possible.
Thanks,
WebGirl x
View Replies !
View Related
Editing Buttons In Flash 2004 Pro
I'm starting to use Flash MX 2004 Pro and I'm having problems with Buttons. Once I create a button, I'm not able to select the button using a left click (L-click). I'm able to get around the problem by R-clicking the button and select edit in place but it's not comfortable. Is there a way to change this so I can L-click to select or enter the button properties? Thanks in advance for the help.
KK
View Replies !
View Related
Editing JPG's In Flash, Mouseovers, Buttons
Hello there,
This is probably a simple question for all computer whiz’s, but I’ve only had Flash MX for a couple of weeks and have got myself totally stuck…
Is it possible to edit a JPG image in Flash MX, if so, how?
What I have done is created an image in Photoshop which I wish to use as a menu bar, but I’d like to have certain sections change color when a mouse passes over it (i.e. one single image with one bit saying ‘News’ another saying ‘Reviews’ etc etc all as one image).
But in the button editing section (where the timeline appears as Up, Over, Down and Hit) I am unable to 'fill' the background area that I wish to change when a mouse passes over it. I can change the area around the image, but not the image.
Why is this and how can I edit the image?
Why cant I just ‘fill’ the background area of a section when I’m in the ‘Over’ section of the timeline so that it appears as a mouse over?
…Hope the above makes sense…???
Any response would be welcome, please remember I’ve only had this for a couple of weeks, so please keep responses as simple and as much in ‘English’ as possible.
Thanks,
WebGirl x
View Replies !
View Related
Editing Buttons In Flash 2004 Pro
I'm starting to use Flash MX 2004 Pro and I'm having problems with Buttons. Once I create a button, I'm not able to select the button using a left click (L-click). I'm able to get around the problem by R-clicking the button and select edit in place but it's not comfortable. Is there a way to change this so I can L-click to select or enter the button properties? Thanks in advance for the help.
KK
View Replies !
View Related
Editing Flash Intro Navigation Buttons?
Hi, Flash learner here. I purchased a template from template monster and 99% is no problem editing it. The issue I have is with the Navigation buttons that are built into the intro. I want to change them to my pages obviously but flash won't allow me to do it. I can change the link for 'HOME' but the rest duplicate this?
Please help :-)
Here's the template I have (unedited) http://www.templatemonster.com/website-templates/19599.html?PHPSESSID=hfljndkv3aimdnutteredjtqd3
Regards
Phil
View Replies !
View Related
Editing Forward And Back Buttons In Gallery
I downloaded an xml gallery setup from FlashDen and need to edit the advance buttons for the thumbnail images. Currently the buttons only advance the thumbnails one at a time. Ideally, I would like them to scroll the thumbnails until you roll out. I would also like to add a scrollbar as well but that's the next stem. I've posed the question to the guy who created it but he doesn't respond back on it. So I've come here for help!
Anyway, here is the code for the back button:
on (rollOver) {
if (thumb_menu._x>thumb_menu.destX-0.5 && thumb_menu._x<thumb_menu.destX+0.5 && thumb_menu._x < thumb_menu.originX -5) {
thumb_menu.destX = thumb_menu._x+(thumb_menu.thumb_mc._width+_parent.thumbSpacing);
}
}
Now here is the heirarchy for the thumbnail setup for this:
menu_mc is a movieclip that contains the bttnPrev and bttnNext advance buttons along with a group that contains the holder for the thumbnails that are loaded. Within that group is a movieclip called thumb_menu which then contains the movngs are nested.
Hope I have given enough info for help.
Thanks,
Dave
View Replies !
View Related
Function For Buttons
i've got something like this (an action for button):
on (rollOver) {
tellTarget ("hint") {
// "hint" is a classic short help
//(small messagebox)
_x=170;
_y=205;
text_field = "...bla bla bla..";
_visible=true;
}
}
on (rollOut) {
tellTarget ("hint") {
_visible =false;
}
}
how can i convert that action script (for 1 button) into a function for 35 buttons (each of them must have a different size and shape)
have u got any idea?
View Replies !
View Related
One Function For Many Buttons
Instead of using one function for every button, I would like to make one function that can be called. I was trying to do this for another who was using several gotoAndPlay(); button. I feel certain there is a way to do this and I thought I had the sure way, but it doesn't work.
I put this code on frame1 of a simple movie with a simple button MC with an instance name of "but1." Can anyone say why this doesn't work? And for extra credit, can anyone suggest an alternate strategy?
Code:
function Go2Frame (F:String){
gotoAndPlay(F);
}
but1.onRelease = function(){
Go2Frame(Here);
}
View Replies !
View Related
How To Get Buttons To Function....
im making a simple flash website and i made my layout and my 3 buttons, i want each button to make a block of text appear when you click on them. sort of like going to another page but just like brings up the content....or makes if appear, if you will.
for example, when i click "contact" i want the contact info to appear, and when i click about, i want the about info to appear, etc....
ive made a nice fade in for everything for when the site first loads if that matters....
ive tried everything and still cant get it to work, im working in flash CS3...
any solutions?
View Replies !
View Related
4 Buttons -----> One Function
hi guys,
i've 4 buttons in the main root...
and if any of them clicked tell mc_main to gotoAndPlay("mainon").
mc_main is a movie clip contains from 20 frames if any buttons clicked it's appear. and if i click on it .
.. it disappear.
it's ok for one button but if i clicked 2 or 3 buttons before click
on it.
so i create this function
ActionScript Code:
onClipEvent (load) { function homeClick() { if (mc_main._currentframe == 10) { // i don't know what i've to write here } else { _root.mc_main.gotoAndPlay("mainon"); } }}
it works greate but if the _currentframe ==10 what supose to happen
View Replies !
View Related
Function For Buttons
Is there a better way to write those code more clean?
Let's say I have several buttons and I want to write a nice function to manage them like that:
For example instead of using:
tab_option1.onRollOut = function() {
gotoAndPlay('transition');
};
tab_option1.onRollOver = function() {
gotoAndPlay('debut');
};
tab_option1.onRelease = function() {
getURL("...","...");
};
How about put them in an array and write a function to manage them instead to rewrite those code again...
Any examples?
View Replies !
View Related
4 Buttons -----> One Function
hi guys,
i've 4 buttons in the main root...
and if any of them clicked tell mc_main to gotoAndPlay("mainon").
mc_main is a movie clip contains from 20 frames if any buttons clicked it's appear. and if i click on it .
.. it disappear.
it's ok for one button but if i clicked 2 or 3 buttons before click
on it.
so i create this function
ActionScript Code:
onClipEvent (load) { function homeClick() { if (mc_main._currentframe == 10) { // i don't know what i've to write here } else { _root.mc_main.gotoAndPlay("mainon"); } }}
it works greate but if the _currentframe ==10 what supose to happen
View Replies !
View Related
[CS3] Editing Video In Flash Or In Video Editing Software First?
I am new to flash and just want to know what seems most logical in putting together some interactivity to my clients website. Described below is what she wants, and i'm wanting feedback as to whether all can be done in Flash or if I might need to combine different applications to create the final product.
She's a romance writer. She wants her website to have items from her book (like real images of an old western saddlebag, letter's, etc...) that when clicked upon, open up and reveal what's inside. So for example, user clicks on an image of an old western saddle bag and the bag opens up to reveal an old letter.
She wants real film/images from a real saddle bag from the local western museum. I'm thinking of tying a string to the saddlebag flap and videoing it opening to reveal the letter and then croping out everything besides the bag? If the video is 2 seconds.. that could be 30 frames to edit? or should i use something like Final Cut Pro to edit the 2-3 secs of video 1st (cropping out bag only) then import to flash? if anyone has any good ideas to get me started in the right direction, let me know! Thx so much.
View Replies !
View Related
How To Add Function To Duplicated Buttons
Hi all
How do I add a different action to duplicated mc which has button inside it? I am trying to do navigation, for that I am duplicating a mc five times..now I need to add function to it..so that I when user clicks it...I want different url to call.
those five mc buttons contains these script
on (press) {
doMyFunction();
}
I want click on:
mc1 = to get url
mc2 = to jump to frame 10 on maintime line or set property
and so on and on....
thanks a lot
PilotX
View Replies !
View Related
Function, Buttons Controling Mc's, Help?
I have buttons that control movieclips, i want all movieclips to goto hide, on a click and have just one show. how do i do this. The movie clips overlap on the stage but are in seperate layers.
this is what i have used in the past but is now giving me errors. the mc's and buttons are in the same timeline
function turnOff () {
_root.1amc.gotoAndStop("hide");
_root.1bmc.gotoAndStop("hide");
_root.1cmc.gotoAndStop("hide");
_root.1dmc.gotoAndStop("hide");
_root.1emc.gotoAndStop("hide");
}
i am also getting this error:
Scene=question1, Layer=actions, Frame=50: Line 4: ';' expected
_root.1amc.gotoAndStop("hide");
can anyone make sense of this??
help please!!!!
View Replies !
View Related
MC Buttons Controlling A Function... How Do I?
This problem is very much a case of me wanting to have my cake and eat it.
I'm loading in external .swf's to a main movie via the code below based in a root keyframe:
Code:
fscommand("allowscale", false);
stop();
but1.onRelease = function() {
nextMovie = "sub_about_02.swf";
cover.gotoAndPlay("close");
};
This, working in conjunction with an MC instanced as 'cover', allows the movie to be stored whilst there is a small transition over the top of the existing movie.
I have normal buttons instanced as 'but1' etc. and everything works a treat.
However, whilst it all works properly, I would very much like to add an extra element of eye candy by adding in the old classic MC buttons (using the old invis button with rollover/rollout/goto script assigned to it). Unfortunately, I can't seem get this to work - I am guessing it is something to do with multiple instance names causing confusion.
So my question is:
Is it possible to control the above function using an MC Button? If so, any suggestions on how it could be done?
If anyone could find the time to help me out, I would be most grateful.
Cheers
View Replies !
View Related
Question About A Function And Buttons
Hey everybody :-)
I have a little question regarding a clip I'm doing.
I'll simplify the whole thing just to make it easier for everybody
to understand what I'm asking.
I made 3 buttons, and in I wrote this code to make each button
pop up a trace message with the text "okay"
MC3.onRelease = function():Void{
trace("okay");
}
MC_button2.onRelease = function():Void{
trace("okay");
}
button1.onRelease = function():Void{
trace("okay");
}
and its working great, B-U-T what I want to do is to write a function that inside it I'll write the code and the function (using parameters) will know which button I clicked.
so I wrote this code:
(I wrote it as an example for clicking on MC3 button)
Clicked(MC3);
function Clicked(number:String):Void{
number.onRelease = function():Void{
trace(number + " okay");
}
}
what I thought would happen is that "number.onRelease" would change to "MC3.onRelease", but it didn't... so I guess it is impossible to use parameters instead Instence names.
so what else can I do to with functions to make this work???
THANLS ALOT!!!
View Replies !
View Related
Double Function Buttons
How do you create a button that when pressed, it does one action, such as go to a frame, and when pressed again, go to another frame?
It has to be the same button, as it controls the playback of another MC.
Thanks
--iMat
View Replies !
View Related
Buttons-rollover Function
i have 4 'buttons' on my page. they down have any 'down' functions, but they have rollover functions. they are set in a square, so when you roll over one what its supposed to do is enlarge so that it covers the other three and becomes a big square.
the problem i'm having is the roll over is not showing up on top of all the other buttons, rather its on top of some and behind others. i know i can bring the object to front, or create different layers, but i'm still going to have that problem with 3 out of the 4.
can someone tell me how i can fix this?
thanks so much!
View Replies !
View Related
Multiple Buttons One Function
I have multiple buttons that I want to add the same function to.
What is the correct syntax to do this???
ie:
Code:
(row1.butt,row2.butt).useHandCursor = false;
or:
Code:
row1.butt,row2.butt.onRollover=fucntion(){
MyGlowfunction()
}
without having to type out
Code:
row1.butt.useHandCursor = false;
row2.butt.useHandCursor = false;
row3.butt.useHandCursor = false;
row100.butt.useHandCursor = false;
(btw I need to have the hand cursor on some buttons else I would rid the hand cursor completely.)
Many cheers
View Replies !
View Related
[F8] Multiple Buttons One Function
I want to have 10 buttons on the stage btn_1 etc up to 10. Is it possible to have one function to detect the buton being pressed rather than a seperate MouseDown MouseUp etc for each button the code becomes massive I have tried using a for loop as in btn_i but it does not work any advice hints appreciated
View Replies !
View Related
FullScreen Function In AS2 (Buttons?)
I'm currently doing a FullScreen command for a client using AS2. Functions are working but only as a contextual menu. I want to add two buttons as well. One that appears when you first see the .swf that when you click on it, it expands it to fullscreen mode. The other is for taking it back to normal viewing mode. Neither function is working and I can't figure out the fix. Here's my code if anyone can figure it out.
PHP Code:
import flash.geom.*;stop();normal_btn._visible = "0";feature._visible = "0";// functions to enter and leave full screen modefunction goFullScreen() { // when going out of full screen mode // we use these values feature.savedWidth = feature.width; feature.savedHeight = feature.height; feature.savedSmoothing = feature.smoothing; feature.savedDeblocking = feature.deblocking; // Set the size of the video object to the // original size of the video stream feature.width = myVideo.videoWidth; feature.height = myVideo.videoHeight; feature.smoothing = false; feature.deblocking = 0; Stage["fullScreenSourceRect"] = new Rectangle( feature.x, feature.y, feature.width, feature.height); Stage["displayState"] = "fullScreen"; fs_btn._visible = "0"; normal_btn._visible = "1";}function exitFullScreen(){ Stage["displayState"] = "normal"; fs_btn._visible = "1"; normal_btn._visible = "0";}// function to enable, disable context menu items, based on which mode we are in.function menuHandler(obj, menuObj){ if (Stage["displayState"] == "normal") { // if we're in normal mode, enable the 'go full screen' item, disable the 'exit' item menuObj.customItems[0].enabled = true; menuObj.customItems[1].enabled = false; } else { // if we're in full screen mode, disable the 'go full screen' item, enable the 'exit' item menuObj.customItems[0].enabled = false; menuObj.customItems[1].enabled = true; }}// create a new context menuvar fullscreenCM:ContextMenu = new ContextMenu(menuHandler);// hide the regular built-in itemsfullscreenCM.hideBuiltInItems();// now, add the items to enter and leave full screen modevar fs:ContextMenuItem = new ContextMenuItem("Go Full Screen", goFullScreen);fullscreenCM.customItems.push( fs );var xfs:ContextMenuItem = new ContextMenuItem("Exit Full Screen", exitFullScreen);fullscreenCM.customItems.push( xfs );// now, attach the context menu to any movieclip in your movie.// here we attach it to _root, (even though using _root is generally a bad idea,)// so it will appear if you right click anywhere on the movie._root.menu = fullscreenCM;fs_btn.addEventListener("click",goFullScreen);normal_btn.addEventListener("click",exitFullScreen);
View Replies !
View Related
Can Multiple Buttons Use The Same Function In AS3?
I have a function that is called by all buttons. In AS2 It would look like this:
Code:
function buttonClicked(which:String){
switch(which){
case"start":
PlayGame();
break;
case "toggleSound":
toggleSound();
break;
case "instructions":
gotoAndStop("instructions");
break;
}
}
In AS3 you attach listeners and pass the event, but I can't figure out how to know exactly which button called the function. Do I need a seperate function for each button? Or is their a way to pass parameters? Please help.
View Replies !
View Related
Loop To Set Function To Buttons
Hello, im having some trouble with these buttons. Whenever i run it, when i trace the variable in stopThis, it alwasy comes up with 25, no matter which button i press. Any ideas on how i could do this differently? Or what the problem with my code is.
ActionScript Code:
for (var i = 0; i<=25; i++) {
_root["symbolName"+i].onPress = function() {
startDrag(this, true);
}
_root["symbolName"+i].onRelease = function() {
stopDrag();
_root.stopThis(i);
};
}
View Replies !
View Related
Multiple Buttons... One Function
Hi, please help me work this around.
I want to create several buttons (named b_1, b_2, etc), each one has its respective eventListener, but I want to point them all to one only function, this funtion will "trace" a number depending on which button was clicked.
Usually I would just use the switch/case method to "recognize" which button was clicked, but this time my buttons are created dynamically (based on the number of items on a changing XML list) so its a different quantity of buttons every time I run my movie.
Can anyone help me figure out a solution?
View Replies !
View Related
Same Function For Multimple Buttons...
Im creating several buttons (about 5) and on rollover I want them to have the same Tween function effect, but when i try and call the function it is not targeting the movieclip... i have used 'this' as the tweener target, but this is not working?
function rollover() {
trace("hit")
Tweener.addTween(this, {_alpha:100, time:0.2, transition:"easeInSine"});
}
bt1.onRollOver = function(){
rollover();
Tweener.addTween(this, {_alpha:100, time:0.2, transition:"easeInSine"});
}
any ideas?
Thanks
View Replies !
View Related
{FMX} One Function For Multiple Buttons?
Hiya,
I am building an interactive world map, and for ease of updating am slapping all the functions in a frame on the main timeline.
Say I have a the word "Belgium" with a generic button symbol underneith it (instance name of Belgium of course), and also the maps shape of Belgium, as a button labeled, say Belgium_Map , each requiring several functions for rollovers, movement etc, is it possible to simple write one expresion and apply it to both buttons?
Im sure, like most things that one gets stumped on, it is pretty simple, however Im not sure of the syntax...
My code looks something like this:
buttons.belgium.onPress = function(){
map:scale_target = "250";
map_target = "-1050";
map:y_target = "-280";
locations_target = "-250";
country="Belgium"
toptextfade.gotoAndPlay("fadein");
};
So can I apply it to my completly separate button with the path map.europe.belgium as well, without having to write out all that crap again for each, when they execute the same things?
Please help, as it will my make my thousands of pages worth of code a bit tidier!
Ill post it as open source once Ive finished aswell, as its pretty cool.
Cheers
View Replies !
View Related
Using Animation Function With Buttons.
Hey!
What I'd like to create is a menu. Let's say, menu has 4 buttons. But instead of creating each a animation (which is the same for all of them) I'd like to create an animation function and use the function with the buttons. The question is how to create such function and integrate it with buttons. The animation function should contain onRollOver and onRollOut functions too for start. For animations I will use AS 2.0. mx.transitions.Tween.
All kind of help is awaited.
Thank You in advance
View Replies !
View Related
{FMX} One Function For Multiple Buttons?
Hiya,
I am building an interactive world map, and for ease of updating am slapping all the functions in a frame on the main timeline.
Say I have a the word "Belgium" with a generic button symbol underneith it (instance name of Belgium of course), and also the maps shape of Belgium, as a button labeled, say Belgium_Map , each requiring several functions for rollovers, movement etc, is it possible to simple write one expresion and apply it to both buttons?
Im sure, like most things that one gets stumped on, it is pretty simple, however Im not sure of the syntax...
My code looks something like this:
buttons.belgium.onPress = function(){
map:scale_target = "250";
map_target = "-1050";
map:y_target = "-280";
locations_target = "-250";
country="Belgium"
toptextfade.gotoAndPlay("fadein");
};
So can I apply it to my completly separate button with the path map.europe.belgium as well, without having to write out all that crap again for each, when they execute the same things?
Please help, as it will my make my thousands of pages worth of code a bit tidier!
Ill post it as open source once Ive finished aswell, as its pretty cool.
Cheers
View Replies !
View Related
Multi Function Buttons
i want to create a button that when you click it once one event happens you click it again and another thing happens and yet again you click and something else happens. i found a post about doubel purpose buttons that had this code
on(release) {
if (myVar == 1) {
myVar=0; fill in here;
}
else {
myVar=1; fill in other case here;
}
}
thats exactly what i want to happen but with 3 different outcomes. how can i change to code to allow this to happen?
View Replies !
View Related
Buttons To Function Like Undo And Redo
Hello,
I was wondering if we could create buttons which could undo any previous action performed in the movie.
Is there any way to track all the commands or actions performed by the objects in the movie.
If we can get this then probably we can use these to either undo or redo those actions
can someone guide me with this
View Replies !
View Related
Animating Function Generated Buttons
below is some script which i am using to create a submenu, i have been trying to add to it to make the buttons 'slide out'
(i.e. one moving to the right into a position then generating the next button where the first stopped and sliding to a new position and so on..)
i've been trying to use the setInterval command with no joy and am wondering if im barking up the wrong tree.
can anyone point me in the right direction?
// generate submenu
function gensubmenu() {
_root.attachMovie("submenu_mc", "submenu", 2, {_x:50, _y:200});
for (n=0; n<_root.selectedCount; n++) {
_root.submenu.submenuItem.duplicateMovieClip("subm enuItem_"+n, n);
currentItem = _root.submenu["submenuItem_"+n];
currentItem.labelName = _root.selectedNames[n];
currentItem.frameName = currentItem;
if (n != 0) {
prevItem = _root.submenu["submenuItem_"+(n-1)];
currentItem._x = prevItem._x+(prevItem._width-prevItem._height);
}
}
_root.submenu.submenuItem._visible = false;
}
View Replies !
View Related
Function For Multiple 'loadmovie' Buttons?
hi
i have a bunch of buttons that load SWFs into my my main movie. All of the buttons have the same 'loadmovie' code except for the SWF filenames each loads. can i place a function in the timeline that does the loadmovie action for each but inserts the correct filename corresponding to the button pressed? this way i won't have to copy and paste the code over and over for each button. thanks!
View Replies !
View Related
HitTest Function Embedded In Buttons
I have a button. On mouseOver I have this button divided into 4 pieces, so in the OVER state of the button I have placed two movie clips, each supposed to link to a different file when clicked. The link is not working, though.
So the question is how do I properly script these two MC's, placed in the over state of the button, so that when they are clicked they link to the appropriate files. Thanks
View Replies !
View Related
Buttons Function Only On Main Timeline?
it seems that whenever I place a button inside of a MC and then place it on the mainstage, it never works.
once I take the button outside of the MC and just place it on the main timeline, it works. However, this can be mildly inconvenient to the organization of my movie.
why is this? is there a way to get it to work inside of a MC?
thanks.
View Replies !
View Related
Call Same Function In Multiple Buttons
Hi people,
I've got 60 keys.
In each key, I've got a button wich call a function wich is in _root
Example :
In key 1:
on (rollOver) { _root.myfunction(); }
In Key 2:
on (rollOver) { _root.myfunction(); }
etc...
I'd like not to write the same thing in each key...
How to please.....
Pierrot.
View Replies !
View Related
Buttons Inside Movie Function?
Hi,
i have what i think is a question which could be quite easy to answer for someone.
i have a movie clip with a button inside it. i am going to have to duplicate this on the stage about 20 times. each movie will have a name, ie. part1, part2, part3 etc etc. the button within will go to a respective labelled frame on the root, but i don't want to have to duplicate the movie in the library and put the code on each button in each movie.
is it possible to reference the name of the movie clip when i click the button inside it so it? for example, if i click on the button in "part1" it will go to a frame on the root labelled "part1".
i imagine the code on the button to be something like:
on (release) {
_root.gotoAndPlay(GET THE NAME OF THE MOVIE CONTAINING THIS BUTTON AND GO TO THE APPROPRIATELY NAMED FRAME);
}
I hope this makes sense.
All help much appreciated.
Mark
View Replies !
View Related
Function And Actionscript Buttons Help Needed
ok hey guys...I am having a problem with these actionscript buttons that are using function()
I have two movies... shell.swf which is my timeline. on the first frame i am loading another swf named framework.swf into _level100. the buttons i want to control the main timeline are inside the framework.swf in a mc called frame they are named next_btn and prev_btn
I have this code on the 25th frame of the shell.swf...
// _level 100 next/prev button script
_level100.frame.next_btn.onPress = function(){
this.gotoAndPlay("section_2_slide_1");
}
thanks for any help you an give me
Mike
View Replies !
View Related
Can't Get Buttons GetURL Code To Function
Hi all,
I am using Flash 8 Pro on Windows XP. The following code used to work on my previous version of Flash (MX), but seems to no longer function:
on (release) {
getURL ("javascript:NewWindow=window.open('Test.doc','new Win1','width=600,height=600,screenX=hh,screenY=yy, left=hh,top=yy,toolbar=No,location=No,scrollbars=N o,status=No,resizable=Yes,fullscreen=No'); NewWindow.focus(); void(0);");
}
Can anyone tell me if there is a preference or setting somewhere that I should be changing to get it to work again? I've attached a .rar with the .fla. Many thanks.
View Replies !
View Related
[F8]Function Not Working With Movieclip Buttons.
OK so my function just eases a movie clip across the stage on rollover. However it will only work when the script is on a actual Button not a Movie Clip.
Here is whats going on.
First Frame (Write the function)
Code:
function moveArrow(Xcoord){
this.onEnterFrame=function(){
arrow._x+=(Xcoord-arrow._x)/2;
}
}
stop();
Script on button (button is actually a movie clip)
Code:
on(rollOver){
this.gotoAndPlay("over");//over effect
moveArrow(180);
}
So that script works fine if the properties of my button are set to "Button" But it will not work if it is a "Moive Clip".
Is there away arrond this. I guess I could build "hit state" buttons and script around them but that would be a pain.
Any help would be great?
View Replies !
View Related
|