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




Button Questions



Sorry if any of this has come up before, I'm new to the forum. 1. I want to create a button symbol with a photo in it which switches on the mouse rollover. I thought this would be simple enough to achieve by masking. So i put the photo into a circular mask and flash displays the instance of the button how it should look on the stage, when i turn on basic buttons, it also looks and works fine. The problem is when i test or export the .swf file. The masking ceases to work leaving the photo stuck behind the mask layer which has now become visible. I thought i had masking sorted until this happened. Any help would be appreciated. 2. Could anyone direct me to a tutorial on how to get a rollover effect on a button or movieclip so that the instance will play an animation on rollover but then begin playing backwards frame by frame on roll-off. An example would be the buttons on www.fosters.co.uk thanks a lot guys



KirupaForum > Flash > Flash 8 (and earlier) > Flash MX
Posted on: 12-01-2004, 07:05 PM


View Complete Forum Thread with Replies

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

Questions Re: Button Event Code Syntax W/ Variables & Browser Back Button Programming
SHORT VERSION OF MY QUESTION
I have some variables in my movie named backMovie & backFrame, Then I have a button that I'd like to attach the following code to, but obviously I've formatted it incorrectly. Could anyone please offer me the correct syntax for using variables in these instances.

on(press){
loadMovieNum('"+backMovie+".swf',1);
}
on(release){
_level1.gotoAndPlay(backframe);
}


LONG VERSION OF MY QUESTION
I have a movie and my client has now said they cant live without the back and forward buttons on the browser working.....Grrrr

So I did some research on programming the browser back button but determined that it wasn't cross-browser friendly and therefore it was safer to try and create a back button within my movie. The problem is I am loading several multi level swf's and also am a very novice actionscripter (so I'm sure my way is the looong way)

Anyway, I managed to create several variables that change each time a different navigation element is clicked.

What I'm trying to do is reference some of these variable in the programming of my movies own 'back button'. But I don't know how the code should look. My variable names are 'backMovie' & 'backFrame'.....and I've tried variations of the following:

on(press){
loadMovieNum('"+backMovie+".swf',1);
}
on(release){
_level1.gotoAndPlay(backframe);
}


But they don't work

If it helps, I've uploaded my practice files to: http://www.lucid-life.com/back-button-workaround.zip

(It would be a bonus to learn that the actual back button of the browser could be programmed with this actionscript...but I dont think that's possible...is it? and using the anchors method with the back button woudln't work because I'm using levels...right?)

Any help or advice greatly appreciated!
Many Thanks in advance

Cheska

I Have A Button Questions
Hello, i have been using flash for about a month now, i know how to do simple things like motion tweens shape tweening, simple buttons, bit of Action Scripting, but i have a questions, please dont laugh at me

I just tried this, i want to insert a movie clip into the over keyframe of the button setup screen. I tried to do it but it didnt work, so any help you can give me wold be apprieciated!

I Have 2 Button Questions....
My first question is in regards to making a button jump back 10 frames when it is released. Does anyone have a simple action for this? It doesn't sound hard, however I cann't seem to get it to work. Like if I was on frame 122 with a stop action on the frame, how can I get a button to jump back to frame 112 where I have another stop action then back to 102 where I have another stop and so on.

Next question, I have a few drop down buttons and my buttons look and work great, however the drop down buttons will not switch scenes. How can I get them to change scenes? I can get them to change frames, but if I put in a change scene action and put in the scene name they just don't do anything. If I take these buttons out of their dropdown movie clip they work fine and will change scenes. How can I get these to work, is it some .parent.host thing?

Thanks for any ansewers.

Button Questions
First off... I'm using Flash MX 2004.

EDIT: Okay, I'm going about this a different way now.

I want a button that when I click it, it goes to the next scene.

I have this script running:


Code:
ButtonNo.onRelease = function (){
gotoAndStop("Scene 2", 1);
}
The problem is, it doesn't go to Scene 2 on release, it goes if I press enter. How can I make it do it with the mouse?

Button Questions And Help
Hello Everyone,

I have a few question regarding the below code please read on.

Thank You


Code:
function detectID () {
var boxNames = ["yb", "ob", "rb", "bb", "pb", "gb"];
var lngth = boxNames.length;
for (var i = 0; i < boxNames.length; i++) {
var box = this[boxNames[i]];
box.id = i;
box.onRollOut = function () {
myOnRollOut (this.id);
};
box.onRelease = function () {
myOnRelease (this.id);
};
box.onRollOver = function () {
myOnRollOver (this.id);
};
}
}
Everything above this line works fine.

Code:
function myOnRollOut (id) {
var boxNames = ["yb", "ob", "rb", "bb", "pb", "gb"];
for (var i = 0; i < boxNames.length; i++) {
var box = this[boxNames[i]];
if (i != id) {
}
else {
myRollOut (box);
}
}
}
The above code works fine till I add the "myOnRollOver" function then all the other buttons continue to work except the buttons targetted with that function.


Code:

function myOnRollOver (id) {
var boxNames = ["yb", "ob", "rb", "bb", "pb", "gb"];
for (var i = 0; i < boxNames.length; i++) {
var box = this[boxNames[i]];
if (id == 0) {
yelBoxRollOver (box);
}
if (id == 1) {
orgBoxRollOver (box);
}
else {
}
}
}
//Yellow Button
function yelBoxRollOver () {
for (var j = 0; j < 1; j++) {
var yelText:MovieClip = (yb.attachMovie ("yelText", "yelText", +j, j));
yelText._width = yb._width;
yelText._y = yb._y;
//Tween
new Tween (yelText, "_alpha", Back.easeInOut, 0, 100, 2, true);
new Tween (yelText, "_y", Bounce.easeOut, 0, 175, 4, true);
}
new Tween (yb, "_alpha", Back.easeInOut, 50, 125, 2, true);
}
function orgBoxRollOver () {
for (var j = 0; j < 1; j++) {
var orgText:MovieClip = (ob.attachMovie ("orgText", "orgText", +j, j));
The above line gives me the error "There is no method with the name 'attachMovie'. Why?

Code:
orgText._width = ob._width;
orgText._y = ob._y;
//Tween
new Tween (orgText, "_alpha", Back.easeInOut, 0, 100, 2, true);
new Tween (orgText, "_y", Bounce.easeOut, 0, 175, 4, true);
}
new Tween (ob, "_alpha", Back.easeInOut, 50, 125, 2, true);
}
function myRollOut (who) {
new Tween (who, "_alpha", Back.easeInOut, 125, 50, 1, true);
}
The last question is regarding Tweening. If I rollover the button quickly and the OnRollOver tween is not complete it does not complete the onRollOut function. Any Fix?

Thank you if you have read this far and you answers are as always much appreciated.

Button Questions
Well, I was wanting to create a button-based detective game (Flash, duh)...

But I have no idea how!

My questions:

I already know how to create a button that does nothing (How to create the 4 frames to create a button).

Call me a noob, and i'll agree.

~ How can I have a button play a multiple-layered video upon press, and have that video not played elsewhere?

~ How can I have a button dissapear and re-appear in a box (For instance: Click a knife and have it appear in an Inventory box)?

~ How can I have a button dissapear on click AND play a movie clip?

~ How can I have a button that only appears during a movie clip?
(Example: You click a button, and a movie clip plays, then another button appears at the last frame of the movie clip, that wasn't available earlier)


Remember, I just got flash 3 days ago, and I know how to:

Create a flash animation (Like stickmen fighting).

Create a useless button (It changes when you put your mouse over it, and press it, but only just changes the button's looks).

What action script is (NOT how to use it).

Please help!

Button Questions
Sorry if any of this has come up before, I'm new to the forum.

1. I want to create a button symbol with a photo in it which switches on the mouse rollover. I thought this would be simple enough to achieve by masking. So i put the photo into a circular mask and flash displays the instance of the button how it should look on the stage, when i turn on basic buttons, it also looks and works fine. The problem is when i test or export the .swf file. The masking ceases to work leaving the photo stuck behind the mask layer which has now become visible. I thought i had masking sorted until this happened. Any help would be appreciated.

2. Could anyone direct me to a tutorial on how to get a rollover effect on a button or movieclip so that the instance will play an animation on rollover but then begin playing backwards frame by frame on roll-off. An example would be the buttons on www.fosters.co.uk

thanks a lot guys

Button Questions, First Flash
ive just started to make a soundboard with flash (lots of buttons, each 1 makes a sound) and im cumin across one or two problems. Ive already dun the layout and kinda made the buttons, so heres whats goin on:

1. ive made one button, and copyed it a load of times so that all id have to do is change the text for each one, meaning i wouldnt have to make a new button each time. Problem is when i change the text in one button, all of them change. How can i make the buttons individual, without having to make them all again

2. ive made a title screen with a start button, but when i test the movie out it just flashes from the title scene to the sound page and back again. Have i made the button wrong or wha

Scroll Button Questions
I am having trouble with my scroll buttons. The way it works is I have a .swf that loads as a movieclip into a main .swf. The scroll bar is a movieclip in the secondary .swf. when i test the secondary swf, the scroll buttons work fine, but when the secondary .swf load in as a movie clip to the main .swf, the scroll butoons no longer work. Can anyone tell me why. Thanks for your time

Got Flash? (Button Questions)...
Hello,first I would like to say hello,I am a newbie-I've used Flash for a couple of months now,but a newbie to this site as well-lol..Okay,so it was corny,forgive me...Anyway,to the point...I have been to a site that makes video games using Flash,and well,I have always wanted to make games,...and I have Flash...You can see where this is going-lol...Anyway,I actually have a logo setup for an opening,I would like it to go into a "title screen" and "loop" back to the title screen and not the first logo.Secondly,I have used tutorials and read books,and I can't find anything on how to use the computer keyboard buttons to "goto" a particular frame,and what I do find,I can't seem to accomplish.The question is how do I set it up so I command to,say "press K to go to frame 1"?something like that???Please help me,and thank you for your time...

...I am aware this question has been asked before-I did search here,and I did try help and tutorials several times on my program,however I couldn't get it right,as well as this pertains to jumping to a particular frame as oppose to manipulating an object...Sorry if this is an inconvenience...

Loop And Button Questions?
I am trying to automate button actions for thumbnails in a gallery. I want to apply onRelease actions using a loop, but this is not working. Is this possible?


Code:
var collectionID:String = "sp05";

for (var i = 1; i<=12; i++) {
this["btnimg"+i+"_mc"].onRelease = function() {
this["btnimg"+i+"_mc"].gotoAndStop("over");
loadMovie("img"+i+collectionID+".jpg", "_root.back_mc");
};

A Couple Of Button Questions
Hi

I have three buttons, when I click on any of them it draws a box and scales it to set position. My questions are as follows:

1. If one button is clicked and the box loaded and all went well and another button is clicked (which obviously draws its own box and scales it). How can I remove any previously loaded boxes before the new one comes swooping in?

2.My other problem is that if the button was clicked once, how can I disable it so that the person can't click on it again and load another instance of the box child?

this is the code I have so far:


Code:
package
{
import flash.display.SpreadMethod;
import flash.display.Sprite;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.events.ContextMenuEvent;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.filters.BlurFilter;
import flash.filters.GlowFilter;
import flash.ui.Mouse;
import gs.TweenMax;
import gs.events.TweenEvent;

public class main extends Sprite
{
public static var origW:Number = 1024 //original stage width
public static var origH:Number = 768 //original stage height

//graphic resources
private var bg:Sprite;
private var cont:Sprite;
private var art:Sprite;
private var photo:Sprite;
private var project:Sprite;

//constructor
public function main ()
{
//Tel the player not to scale the assets
stage.scaleMode = StageScaleMode.NO_SCALE;

//Tell the player to put co-ords 0,0 to the top left corner
stage.align = StageAlign.TOP_LEFT;

//Listen for resize events
stage.addEventListener(Event.RESIZE, onResize);

//Create and add body resource to the display list
bg = new bg_mc();
addChild(bg);

cont = new content();
addChild(cont);

art = new art_mc();
cont.addChild(art);
art.x = 94.2;
art.y = 512.5;

photo = new photo_mc();
cont.addChild(photo);
photo.x = 136.1;
photo.y = 517.9;

project = new project_mc();
cont.addChild(project);
project.x = 150;
project.y = 535;

//Size everything after creation to insure the app is drawn
//properly the first time it is seen prior to any user initiated
//resizing
onResize(null);

art.addEventListener(MouseEvent.CLICK, ClickListener)
art.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver)
photo.addEventListener(MouseEvent.CLICK, ClickListener1)
photo.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver1)
project.addEventListener(MouseEvent.CLICK, ClickListener2)
project.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver)

//set button properties
art.buttonMode = true;
art.useHandCursor = true;
photo.buttonMode = true;
photo.useHandCursor = true;
project.buttonMode = true;
project.useHandCursor = true;

//check ClickListener
function ClickListener(event:MouseEvent):void
{
trace("button clicked:" + event.currentTarget);
var box:Sprite = new Sprite();
box.graphics.lineStyle(1, 0xffffff, 1.0, false, "none");
box.graphics.beginFill(0x000000, 0.5);
box.graphics.drawRect(0, 0, 10, 10);
box.graphics.endFill();
cont.addChild(box);
TweenMax.multiSequence
([
{ target:box, time:0.2, y:625 },
{ target:box, time:0.5, scaleY:12 },
{ target:box, time:1, x:35, scaleX:95 }
]);

}
function ClickListener1(event:MouseEvent):void
{
trace("button clicked:"+event.currentTarget);
}
function ClickListener2(event:MouseEvent):void
{
trace("button clicked:"+event.currentTarget);
}


//Check onMouseOver
function onMouseOver(event:MouseEvent):void
{
trace("mouse over button:"+event.currentTarget);
}
function onMouseOver1(event:MouseEvent):void
{
trace("mouse over button:"+event.currentTarget);
}
function onMouseOver2(event:MouseEvent):void
{
trace("mouse over button:"+event.currentTarget);
}

}
//listening for stage resize
public function onResize(event:Event):void
{
//get the new stage height
var sw:Number = stage.stageWidth;
var sh:Number = stage.stageHeight;

//then update the children with this new size
bg.height = sh;
bg.width = sw;
cont.height = sh;
cont.width = sw;
}
}
}

Thanx in advance for any help

ActionScript For Button Questions
Really, really new to ActionScript. Trying to create a Flash CS3 file where basically after some info is played and a movie and sound, two buttons appear. the “yes” button will collect contact info from person watching it and email back to a person to contact and then go to a frame with some followup text and stop. the second button will just basically go to a different frame with copy and stop. I have been looking in the actionscript manual for sample code for what I am trying to do but havent seen anything. Does anybody know where I can get something to start with?

with much thanks,

Lost in Knoxville

Basic Button Questions
I created a button by creating the button on the up state and inserting blank keyframes for the other states one at a time and then copying-and-pasting in place for each state one at a time.

1. Is there a way to duplicate the Up state for the other states all at the same time? I tried highlighting the other areas and choosing insert keyframe, though this did not work.

2. I placed the button onto the stage and now I want to apply an action that tells it to go to a website when it is clicked. When I select the button on the stage, the actions palette indicates that the current selection can not have actions applied to it. What am I doing wrong?

Thanks.

Basic Button Questions
I want to make a button that onClick simply advances the user to another scene.

1. Does anything done with ActionScript 3.0 require the latest version of the Flash Player?

2. I insert a new button and simply type some text and use F6 to copy the text to the other button states. I drag this new button to the stage of my scene. I simply want to apply an action to this using Actionscript 1 and 2 that will enable this button to go to the next scene when clicked. How is this done?

Thanks.

Button Component Questions...Please Help
I am looking to create a button with a component that changes the text to whatever I choose as well as a button that can play whatever attachMovie "movie" I decide to define onRelease. Is there an onRelease variable I can select and how would I go about defining my component variables to do this. I know how to get the text to change per button but am clueless as to do the latter.

THANK YOU ALL in advance,

Evan

Button Component Questions...Please Help
I am looking to create a button with a component that changes the text to whatever I choose as well as a button that can play whatever attachMovie "movie" I decide to define onRelease. Is there an onRelease variable I can select and how would I go about defining my component variables to do this. I know how to get the text to change per button but am clueless as to do the latter.

THANK YOU ALL in advance,

Evan

A Couple Of Button Questions
Hi

I have three buttons, when I click on any of them it draws a box and scales it to set position. My questions are as follows:

1. If one button is clicked and the box loaded and all went well and another button is clicked (which obviously draws its own box and scales it). How can I remove any previously loaded boxes before the new one comes swooping in?

2.My other problem is that if the button was clicked once, how can I disable it so that the person can't click on it again and load another instance of the box child?

this is the code I have so far:

Code:

package
{
   import flash.display.SpreadMethod;
   import flash.display.Sprite;
   import flash.display.StageAlign;
   import flash.display.StageScaleMode;
   import flash.events.ContextMenuEvent;
   import flash.events.Event;
   import flash.events.MouseEvent;
   import flash.filters.BlurFilter;
   import flash.filters.GlowFilter;
   import flash.ui.Mouse;
   import gs.TweenMax;
   import gs.events.TweenEvent;
   
   public class main extends Sprite
   {   
      public static var origW:Number = 1024 //original stage width
      public static var origH:Number = 768 //original stage height
      
      //graphic resources
      private var bg:Sprite;
      private var cont:Sprite;
      private var art:Sprite;
      private var photo:Sprite;
      private var project:Sprite;
      
      //constructor
      public function main ()
      {
         //Tel the player not to scale the assets
         stage.scaleMode = StageScaleMode.NO_SCALE;
         
         //Tell the player to put co-ords 0,0 to the top left corner
         stage.align = StageAlign.TOP_LEFT;
         
         //Listen for resize events
         stage.addEventListener(Event.RESIZE, onResize);
         
         //Create and add body resource to the display list
         bg = new bg_mc();
         addChild(bg);
         
         cont = new content();
         addChild(cont);
         
         art = new art_mc();
         cont.addChild(art);
         art.x = 94.2;
         art.y = 512.5;
         
         photo = new photo_mc();
         cont.addChild(photo);
         photo.x = 136.1;
         photo.y = 517.9;
         
         project = new project_mc();
         cont.addChild(project);
         project.x = 150;
         project.y = 535;
         
         //Size everything after creation to insure the app is drawn
         //properly the first time it is seen prior to any user initiated
         //resizing
         onResize(null);
         
         art.addEventListener(MouseEvent.CLICK, ClickListener)
         art.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver)
         photo.addEventListener(MouseEvent.CLICK, ClickListener1)
         photo.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver1)
         project.addEventListener(MouseEvent.CLICK, ClickListener2)
         project.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver)
         
         //set button properties
         art.buttonMode = true;
         art.useHandCursor = true;
         photo.buttonMode = true;
         photo.useHandCursor = true;
         project.buttonMode = true;
         project.useHandCursor = true;
         
         //check ClickListener
         function ClickListener(event:MouseEvent):void
         {
            trace("button clicked:" + event.currentTarget);
            var box:Sprite = new Sprite();
            box.graphics.lineStyle(1, 0xffffff, 1.0, false, "none");
            box.graphics.beginFill(0x000000, 0.5);
            box.graphics.drawRect(0, 0, 10, 10);
            box.graphics.endFill();
            cont.addChild(box);
            TweenMax.multiSequence
            ([
               { target:box, time:0.2, y:625 },
               { target:box, time:0.5, scaleY:12 },
               { target:box, time:1, x:35, scaleX:95 }
            ]);
            
         }
         function ClickListener1(event:MouseEvent):void
         {
            trace("button clicked:"+event.currentTarget);
         }
         function ClickListener2(event:MouseEvent):void
         {
            trace("button clicked:"+event.currentTarget);
         }
         
         
         //Check onMouseOver
         function onMouseOver(event:MouseEvent):void
         {
            trace("mouse over button:"+event.currentTarget);
         }
         function onMouseOver1(event:MouseEvent):void
         {
            trace("mouse over button:"+event.currentTarget);
         }
         function onMouseOver2(event:MouseEvent):void
         {
            trace("mouse over button:"+event.currentTarget);
         }
            
      }   
         //listening for stage resize
         public function onResize(event:Event):void
         {
            //get the new stage height
            var sw:Number = stage.stageWidth;
            var sh:Number = stage.stageHeight;
         
            //then update the children with this new size
            bg.height = sh;
            bg.width = sw;
            cont.height = sh;
            cont.width = sw;
         }
   } 
}

Thanx in advance for any help

Complex Control Button Questions
i got a movie, and in the movie, there are play, rewind, pause, and fast foward buttons. (1 of each) firstly, my AS on the rewind and fast foward, is previous keyframe and next keyframe. however, i want it to be smoother. for example, they hold it down, and it keeps going back, smoothly, but not to fast. same for the fast foward. In addition, for the play and pause buttons, i want it to be one; meaning, normally, it appears like the pause button, and when you click it, it pauses everything, however, when you click it, it also changes into the play button. when you click the play button, it changes into the pause button, and resumes the movie. please help me...thanks!

Flash Browser/button Questions
Flash browser/button questions

URGENT!!!

Got a few questions:
1) i have a flash button which i would like to load a specially sized browser window, either by resizing the original browser window, or by opening up a new window and closing the original. Also, i dont want the address bar, buttons, menu buttons, or scrollbar visible in the new resized window.
Iv surfed for an answer in several places, and the instructions they give arent complete.
2) On my main page, i am programming a flash menu structure which i have embedded in a html document. I then have an external document in document script in the middle of the page (a built in window which allows to view an external webpage in a small built in window).
the layout is as follows:

TITLE
EXTERNAL HTML VIEWING WINDOW
MENU STRUCTURE

I would like to know how to TARGET my flash buttons to open up their links into this external document in document script window WITHOUT reloading the entire page.

Thanks..

Flash Browser/button Questions
Flash browser/button questions

URGENT!!!

Got a few questions:
1) i have a flash button which i would like to load a specially sized browser window, either by resizing the original browser window, or by opening up a new window and closing the original. Also, i dont want the address bar, buttons, menu buttons, or scrollbar visible in the new resized window.
Iv surfed for an answer in several places, and the instructions they give arent complete.
2) On my main page, i am programming a flash menu structure which i have embedded in a html document. I then have an external document in document script in the middle of the page (a built in window which allows to view an external webpage in a small built in window).
the layout is as follows:

TITLE
EXTERNAL HTML VIEWING WINDOW
MENU STRUCTURE

I would like to know how to TARGET my flash buttons to open up their links into this external document in document script window WITHOUT reloading the entire page.

Thanks..

Button Animation & TellTarget() Questions
Hey, all...

I'm fiddling around on a weekend project, and I have a a button hidden under a movie clip. The button has the following actionscript:

on (rollOver) {
tellTarget("mclip-a") {
gotoAndPlay(2);
}}

on (rollOut) {
tellTarget("mclip-a") {
gotoAndPlay(50);
}}

The movie clip has a timeline of basicly 1-100, with the first 50 frames being an opening animation, and the last 50 being a closing animation with stop() at frames 1, 49 and 100.

What do I need to add so that even if on(rollOut) occurs before the opening animation is done playing it will first finish and then the closing animation will run?

I was thinking some sort of variables passed between the button and the movie clip so that the button knows when the clip has stopped, but I don't think it's possible to send variables back to the button from the movie.

Secondly, I read that tellTarget() first appeared in Flash 3, and was depreciated by Flash 5. What is the Flash 5/MX equivalent? I wasn't quite sure I understood what the manuals were refering to by "dot notation"... do they mean mclip-a.gotoAndPlay(2);?


Thanks all.

VERY Basic Button Animation Questions
Hey there, I am very new to Flash and I need help with some of the basic programming. I've been able to teach myself the simpler aspects of animation, but programming it to do what I want through action scripting has been a headache. I made the mistake of purchasing Flash MX 04, the version of Flash with only expert mode available for action scripting. Here are some of the problems I've been encountering.

-I've created buttons with animated mouse overs which work, but the animation stops abruptly and doesn't finish if the cursor leaves prematurely.

-Those same buttons activate animations, but I have to hold the button down in order for it to play. The moment I let go, the animation stops. I've tried various different scripts to correct this problem, such as toggle, components>button>click, and onpress, but I must be doing something wrong.

I know it's pathetic, but I've read up on action scripting, bought a book, and spent hours trying to figure this thing out - but I can't seem to get it right. I'm making a web site, and my goal is to have animations appear when you click (not hold) a button. Also, I'd like to include a closing animation that leads to another opening animation when you click a button leading to another part of the site. Hopefully that makes sense, if not I'll try to elaborate. If anyone could help me it would REALLY be appreciated. Thanks in advance.

FlashMX2004 Form/button Questions....
Hi,
I am creating a flash piece where the user can choose the colors of each part of their shoe design and order what they pick. So first I set up the shoe as separate buttons 1-6 so that the user must first select the section to show the corresponding movie clip of colors for that specific section (which consists of buttons).
The user scrolls over a the color to colorize that section. How would I code so that upon clicking on the color it will stay in that area?
Is there a way to code so that the user can press a button at the end which would be a kind of order form using the colors they picked for their shoe. Is there any type of coding that I can assign each button so that when the customer has built their shoe, they can hit a button which interprets their custom shoe and places their results via email or onto a server? For example, a number which would consist of always 111xyyyyyyyyyyzz. y numbers are the color numbers (each color will have a number) for each part of the shoe in order
Also, wanted to see if I was creating this the easiest way possible. - I was trying to create instances of the line of colors (which is a movie clip consisting of many buttons), so that I could easily colorize each section.
Is this possible?
Thanks in advance!

2 Questions - 1.About Button Actions - 2.About Variables
1 - About Button Actions

Can't we attain 2 Button actions at the same time for example


Code:

on (rollOver) {

do something;

}

on (release) {

do something else;

}
this does not work for me, is there a way to do it. Or should i do it with seperate buttons?

2 - Variables

Most of the time i am using loadMovie in my project, but if i am to store the data in a variable. How can i use it in loadMovie

for example;

I want to load movie1.swf

And i keep movie1 in a variable named variable

Now how do i load movie1.swf with using the variable and loadMovie function?

Photogallery From Kirupa Button Questions...
Please forgive me if I missed the answer to this question...I went through the tutorial on the Photogallery with XML. Everything works great BUT is there a way to have the PREVIOUS and NEXT buttons to act like when you "mouse over" the row of thumbnails.

I know they are evaluating where the mouse is and hittest, etc...but I can't figure out how to make that action in the NEXT and PRevious buttons....

I have tried to heighten the hitarea...with no luck....etc...

Any help / guidance would be great...I am stuck.

Here is the code....


function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
description = [];
thumbnails = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
description[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
thumbnails[i] = xmlNode.childNodes[i].childNodes[2].firstChild.nodeValue;
thumbnails_fn(i);
}
firstImage();
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("images.xml");
/////////////////////////////////////
listen = new Object();
listen.onKeyDown = function() {
if (Key.getCode() == Key.LEFT) {
prevImage();
} else if (Key.getCode() == Key.RIGHT) {
nextImage();
}
};
Key.addListener(listen);
previous_btn.onRelease = function() {
prevImage();
};
next_btn.onRelease = function() {
nextImage();
};
/////////////////////////////////////
p = 0;
this.onEnterFrame = function() {
filesize = picture.getBytesTotal();
loaded = picture.getBytesLoaded();
preloader._visible = true;
if (loaded != filesize) {
preloader.preload_bar._xscale = 100*loaded/filesize;
} else {
preloader._visible = false;
if (picture._alpha<100) {
picture._alpha += 10;
}
}
};
function nextImage() {
if (p<(total-1)) {
p++;
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
picture_num();
}
}
}
function prevImage() {
if (p>0) {
p--;
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
picture_num();
}
}
function firstImage() {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[0], 1);
desc_txt.text = description[0];
picture_num();
}
}
function picture_num() {
current_pos = p+1;
pos_txt.text = current_pos+" / "+total;
}
function thumbNailScroller() {
// thumbnail code!
this.createEmptyMovieClip("tscroller", 1000);
scroll_speed = 10;
tscroller.onEnterFrame = function() {
if ((_root._ymouse>=thumbnail_mc._y) && (_root._ymouse<=thumbnail_mc._y+thumbnail_mc._heig ht)) {
if ((_root._xmouse>=(hit_right._x-40)) && (thumbnail_mc.hitTest(hit_right))) {
thumbnail_mc._x -= scroll_speed;
} else if ((_root._xmouse<=(hit_left._x+40)) && (thumbnail_mc.hitTest(hit_left))) {
thumbnail_mc._x += scroll_speed;
}
} else {
delete tscroller.onEnterFrame;
}
};
}
function thumbnails_fn(k) {
thumbnail_mc.createEmptyMovieClip("t"+k, thumbnail_mc.getNextHighestDepth());
tlistener = new Object();
tlistener.onLoadInit = function(target_mc) {
target_mc._x = hit_left._x+(target_mc._width+5)*k;
target_mc.pictureValue = k;
target_mc.onRelease = function() {
p = this.pictureValue-1;
nextImage();
};
target_mc.onRollOver = function() {
this._alpha = 50;
thumbNailScroller();
};
target_mc.onRollOut = function() {
this._alpha = 100;
};
};
image_mcl = new MovieClipLoader();
image_mcl.addListener(tlistener);
image_mcl.loadClip(thumbnails[k], "thumbnail_mc.t"+k);
}

XML Photo Gallery Button Questions?
I've been using the XML flash photo gallery on my site, it works great and it was easy to adapt to fit into my site's layout.

There's one little pet peve I have though, when you get to the end of the gallery, there's still a "next" button there, and likewise at the beginning of the gallery there's a "back" button.. but in both of those cases those buttons don't do anything because at the end there's nothing next, and at the beginning there's no previous frame. So, is there a way to hide those buttons when you're on the first and last frame? Or better yet, just have it loop so if you press back on the first frame it takes you to the last, and then if you click next on the last frame, it takes you to the first?

Radio Button Group Questions (Flash MX)
davep@echurchessentials.com

I have two grouped radio component buttons in frame 1. I also have a "next" button (standard button, not component). I want to the code to enable me to select radio button #1, then the "Next" button, to send the user to frame 2. Or, select radio button #2, then the "Next" button, to send the user to fram 3.

I cannot find any clear help on setting this up. Thank you for your time and support.

Couple Of Quick Questions. Mask And Button Problem.
Hi guys could someone please help me with the following…

I’m trying to learn how to do something via the free samples that cone packaged with flash mx.

If you take a look at the following link…

www.dital.co.uk/help

You will see the swf that I’m working on, the problem is that the movie starts only when the red button is pressed? I would like it to start as soon as it loads rather than pressing a button first.

This is the action script that is within the swf…

// ***Initial State Settings***
// Start bar mask and make it draggable when drag button is pressed
_root.onEnterFrame = function() {
play();
with (circle) {
if (dragging) {
_rotation += 0;
_y += (_root._ymouse-_y)*.3;
}
}
};
drag.onPress = function() {
// Set visibility of Masks and Maskees
scenery._visible = true;
circle._visible = true;
angel._visible = true;
stripes1._visible = true;
stripes2._visible = true;
// start dragging and move button indicator
dragging = true;
depressed._y = drag._y;
// setMask for each maskee
angel.setMask(circle);
scenery.setMask(null);
};

The second problem that I have is that the images appear to ripple when the mask is moved up and down? How can I stop this from happening? I have tried setting the alpha value to 99% on both of them, yet that doesn’t solve it?

Couple Of Pretty Straight Forwards Button Questions
hi, im looking for script for a couple of buttons to pretty much finish up with my current site. I need:

a) a button to send me an email
b) a button that will link to a file to be downloaded (my cv)
c) a button that will open my cv in a browser window

help with any or all of these would be much appreciated
cheers
lev

Several Questions - Delay, Swap Depth, And Forward/Reverse Button
I got several questions, so instead of posting 3 seperate posts and taking up space I'll roll it all in one. Thanks in advance.

Delay
I have a slide show that plays, and it processes the do..while statement to quickly causing flash to crash. All I need is a simple delay. I've noticed setTimeout, but I really don't understand how to use it. Anyone know where to get some documentation on it?

Swap Depth
The slide show I have can also be played 1 frame at a time. I want the picture to swap depths when the user hovers over. However, the slide show is within 2 loaded .swf files. How can I get it to swap depths with the _root or is this even possible?

Forward/Reverse
I have a .flv file and I can play and pause the file using custom buttons that I've made in my swf. How can I get forward/reverse functions?

XML Quiz - Randomizing Questions & Level Of Difficulty Questions
Hi Folks,
I've been tasked to do a quiz in XML with a few caveats and I need some help.

The quiz needs to pull randomized questions from the XML file and also I need to have this sort from 3 levels of difficulty. For example, a user would possibly get fed 3 easy 3 medium or 4 hard questions.

My XML is set up as follows:
<QUIZ>
<QUESTION TEXT="Harry Markowitz won the Nobel Prize in Economics for a paper on portfolio diversification that he wrote while..." ANSWER="2">
<CHOICE>A. on the faculty at Columbia</CHOICE>
<CHOICE>B. a grad student at Chicago</CHOICE>
<CHOICE>C. a janitor at MIT</CHOICE>
<CHOICE>D. a patent clerk in Hamburg</CHOICE>
</QUESTION>
</QUIZ>

These questions are being stored in an array called questionsArray. So I guess all I need to do is call these from the array @ random, but the level thing is really kickin' my butt. Im just kind of lost on this one and I was hoping for some insight all the way around on this. For some reason XML in Flash scares me. It always ends up being nightmare. Someone please wake me up from the nightmare:-

Thanks,
Michael

2 Questions On The Tutorial "Complex Button RollOver/RollOut Effects"
Hi guys.
Thank you for the tutorial, I've been wondering how to make that effect for quite a while now.
I have two questions about it though.

I'm using the effect for a text menu, and I'm wondering how to make a hit area for the text. I'm used to doing that under a Button symbol. I should maybe convert some symbol into a Button instead of Movie Clip or Graphic?

And my next question is how I can have the button stay on the 15th frame when I press it? I'm loading external swf movies when I press the buttons.

Thank you so much in advance.

/Mattias (www.subfusc.se)

"Play" Button Takes Two Clicks, And More Fun Questions
Hey all, my first post!

Here's the deal. I have an animation that runs a movie clip with 13 frames, inside the first frame of the main scene. So, the entire animation is on level 1, but it is contained in the first frame of level 0. got me? good.

Now, I have a button that is supposed to play the movie clip onPress. When the movie is first loaded, the animation begins right away...which is another problem I know. And when the clip is done, it stays on the last frame( I put in a stop(); in the last frame). BUT, when I hit "play" again, it goes to the first frame of the clip, but DOESN'T play. I have to hit the button again to get it to run again.

Any ideas?

Also, I want a preloader screen to run while the other stuff is loading. Should I just make a movie clip and put it in the 1st frame of the main scene, then puch my other clip over to frame 2? Then, with a button somewhere in the preloader, when the user is ready to go see he animation, I could link it to frame 2 and play the original animation. Would this work?

Thanks for the help,
I'm a newbie, so take it easy on me! hehe

Q

Page Up / To Top Of Page Button & General Questions
Hi,

I'm somewhat of a newbie when it comes to programming with flash and I have a few general questions regarding some things.

First off, I was wondering if it is possible to create a button that would act the same as an html anchor within a flash scene, in the way that a "up to top of page" button works (using the a name tag in html)

The reason I would like to do this is because I am designing a page in flash that is going to be around 1024 x 1325 in resolution because of the amount of content I need to display per page/scene, and it would be helpful if I could place this "up to top" button at the bottom of the pages to allow people to easily scroll up to the top of the page.

This also leads into my next question, which is the use of scroll bars within flash. If possible, I would like to make a separate "frame" with scrollbars for these longer "pages" that require me to use the 1325 height specification, so that I wouldn't have to specify an exact width/height for the embedded flash object (ie: using 100% for width & height instead of exact dimensions) and that way the site (embedded flash object) would show up and fill the screen for all different user screen resolutions.

Hopefully this makes sense. I suppose I could also have the "longer" pages be in an entire other flash movie/object, and have the shorter ones reference to them, so that I could specify different widths/heights when embedding into the html file, however I was hoping to use one complete file (swf) for the entire site.

Or if there is a way to have the flash object embedded so that it can fill the browser 100% width wise, but allow for varying heights? I hope I am making somewhat sense here in regards to what I'm looking for

Any help would be appreciated, especially with using anchors as I first mentioned!

Thanks!

Two Sound "button" Questions...?
I was just wondering if you knew off the top of your head the answer to this question. . . . .I had a programmer work on this and he couldn't crack it.

In Flash, I have a .fla file with multiple scenes in it.  Each scene is sort of like a separate "slide" if you will.
On each "slide" there is a .wav file that starts to play narration.  I have made a sound button that toggles the sound off and on for each slide. This works.  But when I press the NEXT button to go to the next scene, the next wav file plays when I want it to be quiet too.
 
Here is the problem. . . .I don't know how to go about making a global sound on/off button.  So that from scene to scene it knows to check to see if the sound is off on previous scene, then don't play sound in current scene.

Does this make sense?
It's easy to do in Director.  
I am wondering if I would have to keep all the scenes in the main timeline.

Any ideas?


Few Questions Projector Questions
I'm making a projector file for use on a CD, and have a few questions--

I'd like to make an exit button that closes the projector-Possible? If so, basic way to do it?

I'd also like to run a bat file on exit (if the whole exit/close thing is possible that is), and know that the fscommand exec has to be used, but can you have an "do this and then close the projector" sort of command on a button?

Last thing-Right now it says Flash Projector at the top of the window-Can this be changed with some autoscript, and if so, how?

I've gone through the tuts (or most of them) and can't find answers to this stuff, so any help would be appreciated--

3 Sound Questions; 2 Other Questions
1.Okay, say you're using an event sound, and you want it to fade out after it reaches a certain point or if you press a button. How do you do it?
The thing that I'm going for is using an event sound that plays as you read text. You can press a button to continue reading the text. I also want the song to loop a couple times, just incase it takes the reader a while to read it all. Then, when you press the last button, the music fades out. How do you do that? I would just make the music cut off, but that would be too choppy.

2. How do you cut out a part of the song? For example: You want the long intro cut out, and the main chorus to play.

(note I have a Mac)
3. I have heard you can convert wav files to MP3 files by using a CD ripper. I used a CD ripper, but it wouldn't import the .wav file. I found other files, but they're either for Window users or shareware. Does anybody have a link to a Mac CD ripper that can convert them that's freeware, or do I just have to pay?

(non-sound questions)
4. I go to a website where they allow you to submit flash cartoons you have made in .SWF format. However, there is no download sign. How do I download it? I have been told how, but it was by a Windows user, and he told me of different options. How do I download it?

5. I'm just curious, but is it possible to import another person's .swf file? I'm just wondering, because one guy said "The sound effects I used were ripped from someone else's flash file".

Thanx for your time.

Questions Question Questions :)
I just have tons of questions :P ... learning is a good acivaty... ok to the question i have... How could one make a gradient move... i want it to follow a object that passes by... i want to do it in code... i have been assumeing that a heavily coded flash site is smaller than a site with more tweens... is that right? i can work in flash but i'm foggy on the details of the program... i have many more questions and need answers...

What is wanted:
I want to create shapes, such as triangles and squares, that are actually made up of small (maybe 5X5 pixel) squares which will make up a "pseudo" gradient mesh (to save on processor load). The end result is to create shapes that simulate light reflecting off a 3D shape and have that light source respond to the mouse cursor.

So imagine a red triangle with the light source being the mouse (or an mc), as the mouse moves, the small squares of different lightness move to simulate the reflection.

Perhaps there is an easier scripted way to do this, that kooky subQuark suggested this wording!

Any help would be appreciated.



thanks ... laters Jimmysomebob

More Questions
Thanks for the latest reply I guess what I really need is the actual code, I kind of understand what needs to happen but have no clue how to actually write the code and where to put it. So I wondered if there is anyone willing to let to write it??? but maybe explain it too, anyway asking for a lot thanks in advance!

2 Questions, Please Help Cgi/php
Hi, I have two questions, one is pretty dumb to the non-beginner... Actually they are probably both dumb, but hey!


Question 1:

I found out the correct path for my cgi/php scripts from my server, but I am not sure what to do now. I use Dreamweaver and when I connect to the server, and look at my site files, they are all under http://www.crossfire.f2s.com folder, and there is no path that says this: /web/sites/047/crossfire/www.crossfire.f2s.com which is the correct path for my scripts, so what do I do to get them where they need to be?


Question 2:

Every time I have questions about why my formmail.cgi hasn't worked in the past, they ask what kind of error message I am getting etc. What are they talking about? Where would I be able to even SEE the error message in the first place? Is there a program I need???

PLEASE HELP! Thanks

Katie

Just A Few Questions
how do you....

make a button or movie that you can drag around with the mouse? i've been trying this:

[using a button called "dragger", with OnMouseEvent
On (Press)
Start Drag(dragger)
End On
On (Release,Roll Out,Release Outside)
Stop(Drag)
End On

ok, i have the target identified, but using "Constrain to rectangle" or "Lock mouse to center" doesn't seem to be doing anything. Right now i just have one frame with this button, the sole purpose being just to try to get this to work. what should i do? i am confused about the Left Top Right Bottom parameters. The button just sits there, unresponsive

Also,

i made another action script in another movie that i was using to loop a set of frames 4 times.

i began in the first frame of this "set" by initiializing a new expression variable, setting it to zero. in the next frames i have a whole bunch of tweens (i am trying to loop clouds moving by in the sky) and at the end i have this:

Set Variable: number=number+1 [number is my variable that i already initialized]

If(number<4)
Go to and Play(204)
End If
If (number>4)
Go to and Play(270)
End If

I tried doing an else instead, I even tried changing the numbers. And yes, i made sure every single thing was set to "Expression"

Please help me! I'd very much appreciate any input.

Just Some Questions, Need To Know
Okay, I used a LOT of quick basic in my day, and in it, the language has a sleep command, a pause if you will. I was wondering, does ActionScript have this command? Example

For X = 1 to 1000
print X
sleep 1
next x

this is a basic for loop for printing the numbers 1 to 1000, but after every number, it pauses for "1", i think it is a second. So, does actionscript have something like this...?

Another question is i cant seem to get onClipEvent(Load) to work... I ahve a movie clip w/ 23 frames. It is a bar, like a loading type thing, but not. i have

onClipEvent (load) {
for (I; I<=10000; I++) {
if (I*Speed >= GetTo) {
Turn = "Yes";
}
Life_Bar.gotoAndStop(math.round((I*Speed/GetTo)*23));
}
}
// this is on the movieclip names Life_bar.

on the frame I initialize the variables

Speed = 25;
GetTo = 1000;
Turn = no;

I really need help on this one, the freakin' bar thing, i cannot get to work and i am goin crazy..... AHHHHH!

Two Questions
hey and thanks in advance...

my questions are 1: Whats the best format for music if you are going to put it into flash, this is for file size and quality...

and 2: i have a html page which a smallish .swf mov in it now is there a way that within the preloader in the .swf to include images loadind on the html page? I don't want it to go past the loading page until all is loaded including any images on the html page...

ok thanks again

D

TWO QUESTIONS...
Ok, first...can someone go to the link below and tell me what I am doing wrong with this scrolling text? I am looking for the simplest way to make the text scroll in a defined area, any help would be greatly appreciated. I have tried several different methods and can't seem to get it to work. This is harder because I am still so new to actionscript.

Go here: http://www.geocities.com/pookie525

Second, I have been trying to create a popup window from a flash button like a javascript one. Therefore when the flash button is clicked, a new window will open at a defined size. I have also tried a few different ways for this one and still can't get it to work.

I believe it starts:
on(release);
getURL("javascript:open.window...

I am not sure how to write this exactly for Flash?

Thank you advance...flash is currently not my friend. :-)

2 Questions....
1st question: Does anyone know if geocities supports CGI scripts? and if so...what i need to get (and what to do with it once I get it)to have a form for my site to work. If not....where can I go to publish my site to test my form out?


2nd question: Can anyone step-by-step me (very much needed baby talk)on how to call on a movie clip from your library when clicking on a button in your main stage/timeline. I would like to know both ways actually...calling on an external .swf AND how to call on a movie clip that in in your library! Thanks -whispers-

I Have Many Questions...
Hi everybody.

I'm working in a website which is done entire in flash. And I´m having some problems.

First:

I have a swf file on a _level0, which is the main movie. When the user clikcs on a button, a second movie is loaded, on level 1. How I have a mouse trail, I have put the mouse trail into a external movie, which is loaded at the begining of the main movie, in a level 2. With this, I get that the mouse pass over the movie in level 1. This trick works OK in the most of the movies.
But I have my first problem when a movie that has a volume slider is loaded in level 1. When the slider is dragged, I loose the mouse trail. The movieclip that replaces the mouse stops in the position slider.

Second:

The slider volume movie is a file that has exported a mp3 file sound. It has too a play button, that works fine in the swf. But if I load the swf movie in the main movie, the play button doesn´t work. I think it´s a problem with the attachSound and LoadMovie actions. I don´t know why the sound movie doesn´t work when it´s loaded into another movie.

Third:

The weight of the sound file is 400KB and I need to put a preloader. But the attachSound action doesn´t works fine with the conventional preloaders. I don´t know how to do a preloader which "preloads" a external file.


I know there are many questions for a only thread. Lot of thanks to anybody who can help me. Excuse me if my english is not good.

2 Questions?
please please help me?

question 1..
how do you target a loaded external movieclip?

question 2..
how do you target the main timeline from the loaded external movieclip?

all help greatly appreciated..

Two Questions :)
I am having trouble with the way my site launches. I have it set up to launch a new window automatically, in the middle of the screen and at a certain % of the monitor size. That part works fine. The trouble is that it does not size the swf with the window, so on large monitors it looks funky.

Here is the url. http://www.home.earthlink.net/~tammit1971

Thanks for the help.

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