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








[F8] Getting Symbols Remembering Their Last State.


Please help.
Is there a way to have symbols (multistate movies as buttons) to remember their state?
Currently if I move the movie to a frame with a symbol, animate the symbol to the on position, then move the movie off the frame containing the symbol. When I move the movie back to the frame with the symbol in it. The symbol has lost it's last state. I would like to have the symbol remember the state. Off or On.

Thanks in advance.

Matt




FlashKit > Flash Help > Flash ActionScript
Posted on: 12-20-2007, 04:29 AM


View Complete Forum Thread with Replies

Sponsored Links:

Multistate Buttons Remembering There State.
I have several multistate buttons or movies that exist on different frames of a timeline(main movie).
When different events happen I move the timeline back and forth between the frames of the main movie.
In the buttons that exist on the frames of the main movie I have given them a property of state. This is checked on the onenterframe and the little button movie is driven to its right state so as to be accurate when next shown. This is not happening. Either the variable is trashed when the main movie is moved to a frame where the button no longer exists or I am attacking this the wrong way.
It would be nice if the code to remember the state was in the button its self so I could easily add buttons as I go with a generic peice of code inside.

Please help
cheers

View Replies !    View Related
Remembering State When Revisiting Webpage With Flash
I need to have our flash application remain exactly as a visitor left it when they revisit that webpage. For example, when a visitor views our homepage, they see our flash introduction and then application. They can modify our visualization and even alter it. They may then choose to visit another webpage of ours and then come back to the homepage by either clicking the home link or the browser's back button. When they go back to the homepage, the flash application needs to be exactly the way they left it.

What's the best way to accomplish this? I can, of course, record every movement on the server and have the flash app read the last known state from the server. Ideally though, the application never actually shut off and it simply reappears when the visitor revisits it.

View Replies !    View Related
Remembering Menu State? Mucho Help Needed
I have a menu that has several sub levels to it. Meaning I have Root buttons and those root buttons change to sub menu options based on what was clicked on from the root level.

I.e Root menu: News, Press, Contact and Advertise

User clicks PRess:

Submenu for Press = : Current Events, Status, Projects and 1QTR

Say the user clicked on 1QTR then it load that SWF into the main movie displaying the 1QTR contents. and the menu goes away.


Good so far...? I hope.

IF the user clicks on the Launch Menu button again while on the 1OTR section I don't want him to have to navigate back to where he was - instead I want my menu to reopen with the options:Submenu for Press = : Current Events, Status, Projects and 1QTR

It is sort of like telling flash to remember my menu location.

Can anyone help. Please could you include a test .Fla. Thank you.

View Replies !    View Related
Remembering Menu State? Mucho Help Needed
have a menu that has several sub levels to it. Meaning I have Root buttons and those root buttons change to sub menu options based on what was clicked on from the root level.

I.e Root menu: News, Press, Contact and Advertise

User clicks PRess:

Submenu for Press = : Current Events, Status, Projects and 1QTR

Say the user clicked on 1QTR then it load that SWF into the main movie displaying the 1QTR contents. and the menu goes away.


Good so far...? I hope.

IF the user clicks on the Launch Menu button again while on the 1OTR section I don't want him to have to navigate back to where he was - instead I want my menu to reopen with the options:Submenu for Press = : Current Events, Status, Projects and 1QTR

It is sort of like telling flash to remember my menu location.

Can anyone help. Please could you include a test .Fla. Thank you.

View Replies !    View Related
Why Is There No Rolloff State In Button Symbols?
Here is a good Sunday morning ponder over coffee question. Why is there no rolloff state in button symbols. I know you can get rolloffs to work in Flash, but since so many people will be using rolloffs, it just seemed to make sense to make it more efficent with the built in feature of it.. They caved on the spellchecker, you never know.

Moojamboo

View Replies !    View Related
Remembering Name
If I want to make a game where the user types their name in at the beginning and then later on if they do something good it says "Well done (their name)!"

How would I go about it?

Thanks

View Replies !    View Related
Remembering A Value
Hi,

Now the final touch to slider for controling audio volume.

This slider is placed inside a MC and it controls the music for this MC alone. The users will have to go back frequently to this MC which is like a main interface.

Now, everytime the page (ie: MC) is loaded, the slider comes back with the original value (that is 100% of the level).

I want that flash remembers the previous setting of the level so that everytime the users come back to this Mc the setting is as it was set before.

this is the script that is placed on an intsance of the slider :
Code:
onClipEvent(load) {
_parent.volSlider.drag._x += 50;
}
onClipEvent(enterFrame) {
vol = _parent.volSlider.drag._x+50;
_parent.au_main.setVolume(vol);
_parent.volAt = Math.round(vol);
}

I understand that there is a variable called [vol] and that this variable is responsible for the level. However, I have no idea of the code to use to make flash remember the value and use it later when loading the MC again.

I'm sure some of you gurus out there must know how to do that.

Thanks

p.

View Replies !    View Related
Remembering Where It Was
Hello all,

I have an html/php/flash project on the go.
I am experimenting on adding to the cart from flash.
I have it working, but on refresh it naturally reloads.
I was wondering if someone could point me in the direction
of a few good threads or tutorials regarding what the solution
would be. I imagine that I'll make a session, or use a cookie
or somehing that will allow flash to remember where it was
and as seamlessly as possible.. be where it was after the refresh.
thank you for any and all advice!

-hroth

View Replies !    View Related
Down State In Drop Down Menu-then Return To Up State When Other Button Is Clicked?
Hi - nice to meet everyone,

The drop down menu I'm referring to is located in the main movie. The menu is a movie clip with the buttons inside and I have each button as 'track as menu item' in the properties. The buttons are linked to external swfs that load into an empty movie clip on the main stage. Everything loads perfectly no problem. The problem is that I can't seem to figure out the right code to put on the sub-menu items/buttons in the drop down menu to show the 'down' state when the corresponding movie is loaded (i.e., about-main button, philosophy [menu item], philosophy movie loaded). Then get it to go back to the 'up' state when another button is pressed in the same drop area part of the menu? I hope I explained myself clear enough without confusing anyone!

I would appreciate any help - I think I'm going to lose my mind - this is driving me crazy!!

Thanks - Allee

View Replies !    View Related
Remembering Variables
Does Flash remember variables if you switch scenes?

View Replies !    View Related
[MX04] Remembering
Ok, I have an input text box in flash movie. I want it so that when my flash is closed, and then started back up again, it is still there if they restart on the same PC, like cookies. Could someone give me step by step info on how to do this? Thanks!

View Replies !    View Related
Remembering Flash 5
I am using Adobe Indesign CS2 for a project. You can import Flash 5 and lower films into AICS2 and export them functioning in an Adobe PDF for Web.

Can someone tell me what is the action script is to apply to a movie instance or button instance to drag it?

THX
ODC

View Replies !    View Related
[F8] Remembering What Frame You Were On.
Is there a way to remember what frame you were on and then have a button bring you back there? Say you have 5 frames and on frames 1 – 4 you have a button that brings you to page 5. Is there a way to create a button on frame 5 that remembers what frame (1 – 4) you came from and brings you back there?

View Replies !    View Related
Remembering That Last Pressed Btn
there are 16 buttons on the stage and I am trying to update a var named lastBtn with the name of the button instance name. I am doing this so when I press another button it will tell lastBtn to close.

here is my attempt.


Code:
var lastBtn;
for (i = 1; i<=16; i++ )
{
_root["b"+i].onPress = function()
{

_root.lastBtn.gotoAndPlay(11);
this.gotoAndPlay(2);
this = _root.lastBtn;
}
}

View Replies !    View Related
Remembering Data, How?
ok cut a long story short. for a website i've been making i have a really good and unique system going. but i need to be able to remember data that has been inputted. for example, if i change the value of a variable or text field. and wish for flash to remember what that was when i reopen it. i need it to remember but currently i don't know how?

so can anyone help me out?

also i would like solutions to be in actionscript 2.0 but 3.0 is ok also. just preferable 2.0

View Replies !    View Related
Remembering Where The User Has Been.
Hey i havnt posted for a while so i was wondering if anyone could hook me up.

Im creating a site for my band at the moment and im making it more of a cinematic experience. (form over function )

ive decided to pump up the frame rate and do some subliminal stuff. (wierd pictures.)

so here goes, i was wondering how i can get flash to tell what the user has been doing to trigger things (eg change mC's or swfs etc.)

for example. if a user decides to view the news section (extenal swf), then returns to the main page. one of the band members will be holding a knife or something stupid and pointless.

i have no idea where to start on something like this so i was wondering if someone could link me to some pages or give me the basic jist of what type of scripting is required (xml?)

thanks alot.

View Replies !    View Related
Having Difficulty Remembering :S
OK,here's the new code,this one at least works,but you have to hit Ctrl+Enter two times(so basically reload it).Any ideas how to make it work the first time around?

Code:
stop();

import fl.transitions.Tween;
import fl.transitions.easing.*;
import flash.display.*;

this.stop();

var image:Loader = new Loader();
var loaded:TextField = new TextField();
var loadedFormat:TextFormat = new TextFormat();
var progressBar:MovieClip = new MovieClip();
var preloader:MovieClip = new MovieClip();
var masker:MovieClip = new MovieClip();
var fadeOutTween:Tween;
var percent:Number;
var imageHeight:Number;
var style:String;
var opacity:Number;

image.load(new URLRequest("image.jpg"));

image.contentLoaderInfo.addEventListener(Event.COMPLETE, Graph);

function Graph(event:Event):void
{
preloader.addChild(image);
imageHeight = image.height;
masker.graphics.beginFill(0xffffff);
masker.graphics.drawRect(0,0,image.width,image.height);
masker.graphics.endFill();
masker.alpha = 0.5;
preloader.addChild(masker);
loaded.width = image.width;
loaded.height = 20;
loaded.y = image.height;
loaded.text = "Loading... 0%";
loaded.selectable = false;
loadedFormat.align = TextFormatAlign.CENTER;
loadedFormat.font = "Verdana";
if(image.width<100)
{
loadedFormat.size = 9;
}
else if(image.width<200)
{
loadedFormat.size = 10;
}
else
{
loadedFormat.size = 11;
}
loadedFormat.bold = true;
loaded.setTextFormat(loadedFormat);
preloader.addChild(loaded);
preloader.x = stage.stageWidth/2-preloader.width/2;
preloader.y = stage.stageHeight/2-preloader.height/2;
addChild(preloader);
this.loaderInfo.addEventListener(ProgressEvent.PROGRESS,Loading);
}

function Loading(event:ProgressEvent):void
{
percent = Math.round((event.bytesLoaded/event.bytesTotal)*100);
loaded.text = "Loading... "+percent+"%";
loaded.setTextFormat(loadedFormat);
preloader.addChild(loaded);
masker.height = imageHeight-imageHeight/100*percent;
if(percent == 100)
{
fadeOut();
}
}

function fadeOut():void
{
preloader.removeChild(loaded);
fadeOutTween = new Tween(preloader,"alpha",None.easeOut,1,0,3,true);
var timer:Timer = new Timer(3000,1);
timer.start();
timer.addEventListener(TimerEvent.TIMER_COMPLETE, proceed);
}

function proceed(event:TimerEvent):void
{
gotoAndStop(2);
}
My suspition is on the this.loaderInfo.addEventListener(ProgressEvent.PRO GRESS,Loading); line,but it might be something else.Thanks in advance.

View Replies !    View Related
Remembering Where The User Has Been.
Hey i havnt posted for a while so i was wondering if anyone could hook me up.

Im creating a site for my band at the moment and im making it more of a cinematic experience. (form over function )

ive decided to pump up the frame rate and do some subliminal stuff. (wierd pictures.)

so here goes, i was wondering how i can get flash to tell what the user has been doing to trigger things (eg change mC's or swfs etc.)

for example. if a user decides to view the news section (extenal swf), then returns to the main page. one of the band members will be holding a knife or something stupid and pointless.

i have no idea where to start on something like this so i was wondering if someone could link me to some pages or give me the basic jist of what type of scripting is required (xml?)

thanks alot.

View Replies !    View Related
Editing Graphic Symbols By Copying And Pasting To Make Slightly Dif Symbols
Hi!

I am using flash to create moving people symbols. I created a "singular person" symbol and saved it, I then copyed a few to make a "bunch of people" symbol, when I go to edit these copyed and pasted symbols each saved symbol changes. Also I am saving them as graphic symbols at the moment.

thanks,

Helen

View Replies !    View Related
Multiple Character Remembering
I am making a game, which a user has to insert a certain order of colors in order to open a lock, but I also need to add a textbox which will display a symbol corresponding to the buttons. I was curious as to how I could make this happen. I am not too sure how to put in a text box, especially since I have Flash 5 , or to have the user put in only one code and the door will open. Thanks!

View Replies !    View Related
Remembering A Button Position
Hi,

im making an interactive map where you can drag a map around and click on certain areas to move to different frames.

I want the map position to be remembered so that when you navigate away from it, and then back again, it is in the position it was when you left it.

the script im using for the drag function is

on (press) {

//Start Dragging Movieclip Behavior
startDrag(this, false, 0, -555, -1100, 0);

//End Behavior

}
on (release) {

//Stop Dragging Movieclip Behavior
stopDrag();

//End Behavior

}

Also, this application is for a pda and i want to use an "exit" button that quits the swf file....any ideas?

thanks

View Replies !    View Related
Remembering Variable Data
Hi folks,

I've always doubt about starting to learn AS3 because I was way more into AS2. But I started to learn it a little. But I'm getting stuck with text input field data.

What I want:
------------------------------------------------
1st frame with a few input text fields which the user can type in names etc. a button which says submit and goes to frame 2, frame 2 need to display the typed text in dynamic text boxes. Thats all actually.
------------------------------------------------

Sounds quite simple to me cause the way I did this in AS2 was not so hard.

AS2:
------------------------------------------------
1st frame:


Code:
btnSubmit.onRelease = function() {
_global.infoArray = new Object();
infoArray.fname = FNAME.text;
infoArray.lname = LNAME.text;
nextFrame();
}
2d frame:

with the function
Code:
drawString(infoArray.fname + " " + infoArray.lname);
------------------------------------------------

But how to do this in AS3? This is what I have

AS3:
------------------------------------------------

Code:
var fname:String = textfield.text;

btnSubmit.addEventListener(MouseEvent.CLICK,ReleaseHandler);

function ReleaseHandler(e:MouseEvent){
gotoAndPlay(2);
}
------------------------------------------------

So it works to type some text and go to frame 2 but how to remember the data and display it properly in a dynamic textbox.

Thnx

View Replies !    View Related
Remembering Objects Between Frames
Hey,

I'm making a platform game where you can move back and forth between the levels. What I also want to do is that if the player has picked up a number of objects on a level(or frame), those objects won't be there next time. I have a piece of code that scans through the level and puts all the objects into arrays which can then be checked for collisions etc. I also have some code that adds objects x-value to a "levelDeletedObjects" array each time the player collides with an object. What I tried to do is when I scan through the level, if any of the object's x-values match with x-values in the levelDeletedObjects array, the object will be deleted from the level and won't be added to the array. This doesn't work though, and I have no idea why :P Can anyone help me with this? The code looks like this:


ActionScript Code:
public function scanLevel() {
            treasures = new Array();
            for(var i:int=0;i<this.gamelevel.numChildren;i++) {
                var mc = this.gamelevel.getChildAt(i);
                if (mc is Coin) {
                    if ((forestLevel1Visited == true) && (currentLabel == "forestLevel1")) {
                        if (forestLvl1ObjectsDeleted.length == 0) return;
                        for (var z:int=forestLvl1ObjectsDeleted.length-1;z>=0;z--) {
                            if (mc.x == forestLvl1ObjectsDeleted[z]) {
                            gamelevel.removeChild(mc);
                            forestLvl1ObjectsDeleted.splice(z,1);
                            break;
                            }
                                                        else {
                                                        treasures.push(mc);
                                                        mc.gotoAndPlay(Math.floor(Math.random()*21-1));
                                                        }
                        }
                    }
       
                    else {
                        treasures.push(mc);
                        mc.gotoAndPlay(Math.floor(Math.random()*21-1));
                    }
                }
               
            }
        }

Regards,

P.s. I already posted this in the games forum, but didn't get any replies so wanted to try posting it here as well.. :P hope that's ok.

View Replies !    View Related
Remembering User PINs
Heya!

I'm working in Flex 2, and I've got a question concerning how to keep track of a set list of user PINs. For the application, each user is assigned a PIN from a list, and once they have completed a task, I need that PIN to be marked as "complete" somehow, so that the person doesn't have to do that task again, even if they come back later and reload the app.

I know nothing of PHP or any sort of database coding. Any help would be most, most appreciated. I really don't even know where to begin.

Thank you very much
-MK72

View Replies !    View Related
Remembering Selected Boxes - HELP
I need a flash program which can remember all the boxes that have been clicked on.

Imagine i have 5 boxes. They are all white, then I click on and it turns red. I want the program to remember that and store the data in a small file.

Can anyone help??

View Replies !    View Related
Remembering Last Movieclip When Drag
i have like more than 5 movieclips on the stage .. and it is draggable and when you drag it and hit the target movieclip this movieclip set to _visible = false; i want to know how i can remember this movieclip so when a new movieclip is drag to the target the last movieclip that was set to _visible = false now can be true and the new movieclip is the one that would be set to false ..thanks .. in advance..

View Replies !    View Related
Remembering Iteration Numbers.
I have this code.

Code:
for (i=1; i<6; i++) {
this.attachMovie("myMovie","unit"+i,i);
this["unit"+i]._x = i*100;
this["unit"+i].onRelease = function() {
trace("Unit number " + i + " was pressed");
};
}
I wan't to trace the number (i) of the button that is pressed.
But no matter what button I press, I always get the value '6' on my trace.
Isn't there a way to store the a value for i in each movie clip attached?

View Replies !    View Related
Question About Remembering The 'hit' Button
hi, i'm working on a website where I want three white buttons to move around a circle. As you hover over them they change colour and when you click on one of them it's content is being loaded into the circle. Simple enough...

But, I want the clicked button to stay in the 'hit' colour untill the user clicks on of the other buttons and then it has to change back to white and the newly clicked button has to stay in colour.

How do I do this? It sounds so simple, but I cant figure it out without some difficult timeline animating and I feel that with a little AS (guys? ) there should be a simpler solution...

hope someone can help me out!

greetings

View Replies !    View Related
Highlighting And Remembering Text
Client Asks Me a Question:

Can you create a flash movie that presents dynamic text content - then allows the users to highlight that content and save the highlighting so they can come back and view it later?

My Answer: I think so?

I know that Flash has a "TextSnapshot Object" that allows you to highlight static text in a movie clip on the fly. But what if the text is not static. Is there anyway to do this? Am I asking the impossible or heading down the wrong road with this TextSnapshot object?

Brian

View Replies !    View Related
Overlapping Symbols Inside Symbols With An Alpha Tween
Hello,

In the attached example, Is it possible to prevent the purple overlap area from showing and just be red since red's on top? I have characters that use symbols for arms, legs, etc. and I want to fade them in and out sometimes. The problem is, the areas where the limbs overlap look weird so I have to resort to converting them to shapes on one keyframe. This seems limiting and annoying. I was wondering if there's a command, extension, or property to fix this. Thanks in advance.

View Replies !    View Related
Is It Not Possible To Assign Instance Names To Symbols Within Symbols In Flash CS3?
Detail question on nha khoa Adobe group

OK, so I have a player object. I created a symbol that is linked to the player. Inside the symbol I have 2 symbols. 1 is the sprite that displays the player, the other is a rectangle box that is used for collision detection.

I tried giving the collision box an instance name in the property editor so I could reference the collision box from code. The Player symbol is linked to a Player class I wrote earlier so it creates an instance of the Player class. The error I get is this:

ReferenceError: Error #1056: Cannot create property myCollBox on Player.

myCollBox was the instance name I gave that collision box symbol. I thought maybe I had to make the collision box also linked to a class to be exported for action script, but that didn't seem to help.

View Replies !    View Related
Remembering A Timeline/function In A Movie
Hi,

We are developing a character type dressing room, which has the ability to to create a customisable character, based on variations to hair, clothing, and hair colour. What we would like to be able to do is have this information stored, so that when the user logs into the dressing room again, the information will be the same as when they last logged out, or saved.

Is there anyone out there with the skills to help with this?

View Replies !    View Related
Remembering Actions From Prev Scenes?
I want to able loop Scene1 until the user clicks on the mouse or hits the right arrow key. Then Scene2 will play, which is a user controlled slide show. here are the problems...

Problem1
Scene2 works if Scene1 does not play before it! It obviously remembers an action from scene1...

Minor Problem 2:
When I press a key (Scene2) it goes through the frames like crazy. How can I get it to just stop on the frame until I press the arrow key again?

Thanks

Brian
<<enclosed .fla>>

View Replies !    View Related
Changing Images (which Requires Remembering The Last One).
Let me start off by saying, I am a very basic flash user, but I learn fast. I am trying to figure out what to do, and I don’t even know where to find the solution for it.

What I am trying to do is:

I have 27 different photos of a room. The photos have a combination of a floor that is wood, gray, or brown. Next the room has a countertop that is blue, brown, or gray. Finally, it either has a wall that is yellow, grey, or blue. When a person clicks a photo with the desired color, I want to it remember what the previous photo had, and change the color of the single item to the one clicked while keeping the other two item colors. The default image will just be a room with a wood floor, blue countertop, and a yellow wall.

Any help or a pointer to a tutorial would be greatly appreciated.
-Adam.

(I am using MX 2004)


EDIT:
What I would like to happen is that all the images are just loaded inside a holder. I would rather the images not be a symbol, but be called from outside flash. I’ve been using this code to call an image.

on (press){
_root.holder.loadMovie("C:
oomimagesLLV_W1_F1_C O1.jpg");
}

When the person selects a different color, for example, clicks the blue countertop while the countertop was brown, the floor was wood, and the wall was yellow, I want the image to change to a blue countertop with a wood floor and a yellow wall.

Any suggestions?

View Replies !    View Related
Form Remembering Values Entered
I have a company that would like me to develop a detailed online form.
They also want to be able to save the data entered if the user should not want to fill all the form in at that particular time.

What way can I do the form so it will remember any data entered (for each indiidual customer too)

View Replies !    View Related
Remembering Last Frame Visited Using SharedObject
I'm a relative newcomer to ActionScripting but I'm working on a project where I need users to be able to check a series of "completed" boxes and have the checks display when they return to the site.

If they happen to put a check in the wrong box, I want them to be able to remove the check with a second click -- so I created some toggle buttons within a two frame (frame 1 - no check, frame 2 - shows a check mark) movieClip. I put the following script in the first frame of the main timeline:

var my_so=SharedObject.getLocal("savedChecks","/");
if (my_so.data.checks!=undefined){
rememberme(my_so.data.checks)
}
button_1.onPress = function()
{
if (this.toggle) {
this.toggle = false;
} else {
this.toggle = true;
}
this.gotoAndStop(2);
};
button_1.onRelease = function()
{
if (this.toggle) {
this.gotoAndStop(2);
} else {
this.gotoAndStop(1);
}
};

button_2.onPress = function()
{
if (this.toggle) {
this.toggle = false;
} else {
this.toggle = true;
}
this.gotoAndStop(2);
};
button_2.onRelease = function()
{
if (this.toggle) {
this.gotoAndStop(2);
} else {
this.gotoAndStop(1);
}
};

button_3.onPress = function()
{
if (this.toggle) {
this.toggle = false;
} else {
this.toggle = true;
}
this.gotoAndStop(2);
};
button_3.onRelease = function()
{
if (this.toggle) {
this.gotoAndStop(2);
} else {
this.gotoAndStop(1);
}
}

I have also included the following on each frame of the toggle buttons movie clip, to try to get it to remember which frame the user was on when they exited the site:

function rememberme() {
my_so.data.checks=this._currentframe;
my-so.flush();
}

But I'm still missing something, because it lets me put a check in the box, but doesn't remember it when I exit and return to the site.

I've checked the Flash help file and a couple of ActionScipt reference manuals, but I'm still struggling with this.

I would really appreciate any guidance someone with more experience can provide me here.

View Replies !    View Related
Problem With Remembering Selected Button
hi, i've created three buttons and used this excellent script from http://flash-creations.com/notes/act...pofbuttons.php The buttons work fine and it remembers the last selected button perfectly, but I want the movie to start with the first button already selected... I cant figure out how to make this work...

can someone please tell me how to do that?

here's the code that makes the buttons work (this is on the main timeline)

// create an array of all nav buttons in group
var groupinfo:Array = [birds, dogs, bears, giraffes, mice];

// create constants to define start and stop of grow and shrink sequences
// (shrink should be exactly the same sequence as grow, in reverse frame order)
var GROWSTART:Number = 10;
var GROWSTOP:Number = 19;
var SHRINKSTART:Number = 20;
var SHRINKSTOP:Number = 29;

// create a variable to track the currently selected button
var activebtn:MovieClip;

// doRollOver: start the rollover action or process,
// unless the button is currently selected
function doRollOver() {
if (this != activebtn) {
// if shrinking, send to corresponding frame in grow
if (this._currentframe > SHRINKSTART && this._currentframe < SHRINKSTOP) {
this.gotoAndPlay(GROWSTART + SHRINKSTOP - this._currentframe);
} else {
this.gotoAndPlay(GROWSTART);
}
}
}

// doRollOut: start the rollout action or process,
// unless the button is currently selected
function doRollOut() {
if (this != activebtn) {
// if growing, send to corresponding frame in shrink
if (this._currentframe > GROWSTART && this._currentframe < GROWSTOP) {
this.gotoAndPlay(SHRINKSTART + GROWSTOP - this._currentframe);
} else {
this.gotoAndPlay(SHRINKSTART);
}
}
}

// doClick: 1) return previously selected button to normal, 2) show visual
// indication of selected button, 3) update activebtn
function doClick() {
activebtn.gotoAndStop(SHRINKSTOP); // return previously selected to normal
this.gotoAndStop(GROWSTOP); // change appearance of selected mc
activebtn = this; // update pointer to current selection
}

// assign functions to each event for each button in the group
function init() {
for (var mc in groupinfo) {
groupinfo[mc].onRollOver = doRollOver;
groupinfo[mc].onRollOut = doRollOut;
groupinfo[mc].onRelease = doClick;
}
}

init();

thanks!
Nix

View Replies !    View Related
Why Is Flash REMEMBERING This Text Data?
Im having a problem here, i dont know if you will know whats happening but...
I have a flash interface which loads some text data from the server and when you put another search in everything will change (pictures) exept the text because it remembers the old data :S any ideas???

ive tryed:

function clearPreviousInfo() {
// ---------------------------------- clear disc info for new lookup
discs.diameter.text = "";
discs.hub.text = "";
discs.height.text = "";
discs.thickness.text = "";
discs.bolts.text = "";
discs.vented.text = "";
// ---------------------------------- clear disc info for new lookup
caliper.pistons.text = "";
caliper.mment.text = "";
caliper.lead.text = "";
caliper.oe.text = "";
caliper.pistondiam.text = "";
// ---------------------------------- clear disc info for new lookup
piston.seal.text = "";
piston.gaiter.text = "";
piston.crown.text = "";
piston.height.text = "";
piston.bottom.text = "";
}

View Replies !    View Related
Active Button State/3 State Buttons
http://www.thecodebehind.com/code/flash ... state.aspx

Does anybody know anything about implmenting the above - but via an external class (.as) file?

I'm still learning, and so it's a bit much to wrap my brain around...

View Replies !    View Related
Problem With Flash 6 Form Remembering Data
I've got a huge Flash 6 form and I've got a couple of validation methods going on in my AS that if certain fields aren't filled out, you go to another keyframe telling people to go back and fill the proper data. So I test the movie and all the previously entered data is all gone! Since this form is enormous (it's an employment application) it would take an eternity to complete it all and have to refill it because one field isn't filled out isn't very fair. So how can I keep my data in that other keyframe without losing it?

View Replies !    View Related
Quiz With Scores And Remembering Radio Buttons
Hats off to shana_uk for putting most of the attached file together.

I would like to develop it to allow the user to skip questions and return to them, but am having 2 problems.

1. when you return to a question, the radio button you checked is no longer checked.

2. i figured there must also be a way to put all the marking at the end as all the variable names are different anyway, but it seems the Change Handler button has to be in the same keyframe as the radio buttons.

Anyone have any ideas? Perhaps we can use shana_uk's as a working document.

View Replies !    View Related
Over State Sound Replays On Down State
I am using Flash CS3 with AS3 and I just can’t figure out why when I put a sound on the over state of a button it plays again on the down state as well.

If you could please try this yourself and let me know what I am doing wrong I would greatly appreciate it.

1. Draw a rectangle 2. Convert to button 3. Double click on button and add key frames for up/over/down/hit states 4. Select the over state 5. Drag a sound onto the stage to add to over state 6. Ctrl + Enter to test movie

If you are having the same problem I am the sound will play on both the over and down states. Let me know if you know what I am doing wrong!

Thank you for your time.

View Replies !    View Related
Over State Sound Replays On Down State
I am using Flash CS3 with AS3 and I just can’t figure out why when I put a sound on the over state of a button it plays again on the down state as well.

If you could please try this yourself and let me know what I am doing wrong I would greatly appreciate it.

1. Draw a rectangle 2. Convert to button 3. Double click on button and add key frames for up/over/down/hit states 4. Select the over state 5. Drag a sound onto the stage to add to over state 6. Ctrl + Enter to test movie

If you are having the same problem I am the sound will play on both the over and down states. Let me know if you know what I am doing wrong!

Thank you for your time.

[Moved by Mod]

View Replies !    View Related
Movie Symbols Vs Graphic Symbols
to movie or to graphics?

I remmember in flash 5 movie symbols compiled smaller than gaphic symbols. is that still the case in Flash MX?

View Replies !    View Related
Graphic Symbols Vs Movie Symbols
to graphic or to movie?

I remmember in flash 5 movie symbols used to compile smaller than graphic symbols...is that sitll the case in flash MX?

View Replies !    View Related
Listeners On Symbols With Symbols Inside Of Them?
I have a symbol (a) with a symbol (b) inside. I have a rollover listener on symbol (a) however, when I roll over symbol b inside of symbol a I loose my "MOUSE_OVER".

It is as if symbol b stops its parent from being considered "rolled over"

Am I building these wrong? or mis-understanding something?

I need it so that the rollover for symbol a works no matter what is inside it.

Thanks!

View Replies !    View Related
Load Variables, Remembering Variables
I am trying to load variables from a text file, and have them available from then onwards in the movie, globally so to speak.

While I can read the variable values in a loader function which executes when the text file is loaded, I don't seem to be able to keep those variables available afterwards.

How do I that? Isn't AS3 wonderful? :(

John







Attach Code

var urlRequest:URLRequest=new URLRequest("index.as3.txt");
var urlLoader:URLLoader = new URLLoader();
urlLoader.dataFormat=URLLoaderDataFormat.VARIABLES;
urlLoader.addEventListener(Event.COMPLETE, urlLoader_complete);
urlLoader.load(urlRequest);

var sspColourBG;

function urlLoader_complete(evt:Event) {
trace("During: " + urlLoader.data.extColourBG); // returns correct value
}

trace("After: " + sspColourBG); // returns undefined

View Replies !    View Related
Button Symbols Inside Button Symbols
Can someone correct me if I am wrong... but I want to confirm that button symbols cannot be placed inside the rollover frames for other button symbols(?)

I was making a button roll over effect.

Btn Symbol 1 (the primary) needed an 'over' image, so I made Btn Symbol 2 and place it on the keyframe; however, the rollover effect would only work if used the original bitmap OR a Graphic Symbol in the 'over' frame for the button.

Just wanted to make sure I was understanding this correctly - basically, that you can't place button symbols inside the rollover frames for a button symbol.

Thanks...

View Replies !    View Related
Over State
Hi I am trying to make some buttons for my flash video that have an over state that trigger a picture at the left to fade in after about 2 seconds as well as adding a little fx to the roll over. Is this possible? PLEASE HELP!!!!

THANKS!!!

View Replies !    View Related
Over State
I am wondering if you can add that popup text that is so helpful on the web you know when you roll over a button or a picture and you get that text that tells you what it is and maybe a brief description. I want to add that to my buttons. I am using those cheesey arcade buttons that flash provides for you to use in the libary. How can this be done??

Thanks!!

View Replies !    View Related
Down State
My Objective: if the home page is loaded then the home button is pressed down so the user knows thats where they are.

Idea to do this: Pass the movie a variable which tells it the page and then tell the movie to load and show the down state of the button.

How far I have got: I am using some asp.net code to pass a flashvar into the movie which all works. For this example it passes the value "btnhome" to the movie. I have then created this actionscript.

var topressdown = _root.topress;
if (topressdown == "btnhome") {

}

Problem: I don't know what to put in the curly brackets.

Can anyone help?

View Replies !    View Related
Copyright © 2005-08 www.BigResource.com, All rights reserved