Help With Resetting Movie
Hello all,I'm new here and just recently I've started training on flash. I've got a movie up and running that may be introduced into a new site that my company is working on, but I can't figure out why this keeps happening. I have 4 buttons at the bottom of 300x300 box. Each button has an "onRollOver" event attached to it that sends the playhead to another frame. The button on the bottom right works most of the time, but there are occasions that when rolling in and out in different patterns, it sends my movie back to the beginning. Now while I'd rather it didn't go back to the beginning at all, there are times that it even alters the way my movie plays when it resets it such as preventing something from fading in that was fading in previously.I'd love to attach the fla file, but I'm not sure how. I'll attach the code that is contained in the 4 frames that each button links to.... be gentle if I've done something in a roundabout way.... I'm pretty new at actionscript...Basically, the movie opens up with 4 different backgrounds fading in and out using a setInterval command with "5000" as the interval. Each background has dynamic text (updated using 4 text files) and a picture that appears with it (this is just a mock up, so the pictures are crap). There are 4 buttons at the bottom that are there throughout the entirety of the movie. Now, when a button is rolled over, it then links to these other frames and STOPS the interval fading and only moves between frames through the rollover options. Frames 50-54 are the fading frames and frames 70-73 are the rollover frames.I've attached the code for 70-73, and the sample from frame 53 will be basically the same for all of frames 50-54 except for a few different instance names and such (I actually labeled it frames 50-55 below but it only goes through 54).I would be very appreciative of any suggestions specifically on why it might be doing this. Any other suggestions on how to clean up my code, or something that could condense the amount of code I'm using would be welcomed also, but most importantly I'd like to figure out the problem at hand.Thanks for everything guys.EDIT: I'm using flash professional 8 and AS2EDIT #2: Sorry, I don't comment or use any kind of documentation in my work very often.Attach Code---------------------Frame 70 code-----------------------stop();clearInterval(MyInterval);pic1_mc.alphaTo(100,1,"linear")bleedThrough_mc.colorTo(0x127CC2, 1, "linear");announcementsPicture_mc.alphaTo(10, 1, "linear");essentialsPicture_mc.alphaTo(0, 0, "linear");rgbaVantagePicture_mc.alphaTo(0, 0, "linear");webTutorialPicture_mc.alphaTo(0, 0, "linear");essentials_btn.onRollOver = function() {gotoAndPlay(71);};rgbaVantage_btn.onRollOver = function() {gotoAndPlay(72);};webTutorial_btn.onRollOver = function() {gotoAndPlay(73);};myData = new LoadVars();myData.onLoad = function() {introText_txt.htmlText = this.content;};myData.load("BlueText.txt");------------------------------------------------------------------------------Frame 71 Code----------------------stop();clearInterval(MyInterval);pic2_mc.alphaTo(100, 1, "linear");bleedThrough_mc.colorTo(0x01A302, 1, "linear");announcementsPicture_mc.alphaTo(0, 0, "linear");essentialsPicture_mc.alphaTo(10, 1, "linear");rgbaVantagePicture_mc.alphaTo(0, 0, "linear");webTutorialPicture_mc.alphaTo(0, 0, "linear");announcements_btn.onRollOver = function() {gotoAndPlay(70);};rgbaVantage_btn.onRollOver = function() {gotoAndPlay(72);};webTutorial_btn.onRollOver = function() {gotoAndPlay(73);};myData = new LoadVars();myData.onLoad = function() {introText_txt.htmlText = this.content;};myData.load("GreenText.txt");--------------------------------------------------------------------------------Frame 73 Code-----------------------stop();clearInterval(MyInterval);pic1_mc.alphaTo(100,1,"linear")bleedThrough_mc.colorTo(0xFF711F, 1, "linear");announcementsPicture_mc.alphaTo(0, 0, "linear");essentialsPicture_mc.alphaTo(0, 0, "linear");rgbaVantagePicture_mc.alphaTo(10, 1, "linear");webTutorialPicture_mc.alphaTo(0, 0, "linear");announcements_btn.onRollOver = function() {gotoAndPlay(70);};essentials_btn.onRollOver = function() {gotoAndPlay(71);};webTutorial_btn.onRollOver = function() {gotoAndPlay(73);};myData = new LoadVars();myData.onLoad = function() {introText_txt.htmlText = this.content;};myData.load("OrangeText.txt");----------------------------------------------------------------------------------Frame 74 code-----------------------stop();clearInterval(MyInterval);pic2_mc.alphaTo(100, 1, "linear");bleedThrough_mc.colorTo(0xFC4D30, 1, "linear");announcementsPicture_mc.alphaTo(0, 0, "linear");essentialsPicture_mc.alphaTo(0, 0, "linear");rgbaVantagePicture_mc.alphaTo(0, 0, "linear");webTutorialPicture_mc.alphaTo(10, 1, "linear");announcements_btn.onRollOver = function() {gotoAndPlay(70);};essentials_btn.onRollOver = function() {gotoAndPlay(71);};rgbaVantage_btn.onRollOver = function() {gotoAndPlay(72);};myData = new LoadVars();myData.onLoad = function() {introText_txt.htmlText = this.content;};myData.load("RedText.txt");---------------------------------------------------------------------------------------------Sample code from frames 50-55--------------------------//Red BackgroundclearInterval(MyInterval);bleedThrough_mc.colorTo(0xFC4D30F, 1, "linear");webTutorial_mc.alphaTo(10, 1, "linear");rgbaVantage_mc.alphaTo(0, 1, "linear");pic2_mc.alphaTo(100,1,"linear")myData = new LoadVars();myData.onLoad = function() {introText_txt.htmlText = this.content;};myData.load("RedText.txt");announcements_btn.onRollOver = function(){gotoAndPlay(70);}essentials_btn.onRollOver=function(){gotoAndPlay(71);}rgbaVantage_btn.onRollOver=function(){gotoAndPlay(72);}webTutorial_btn.onRollOver=function(){gotoAndPlay(73);}MyInterval = setInterval(function () {gotoAndPlay(54);}, 5000);stop();-------------------------------------------------------------Edited: 05/24/2007 at 10:52:30 AM by Taidaishar
Adobe > ActionScript 1 and 2
Posted on: 05/24/2007 10:41:52 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Swf Keeps 'resetting' Itself Within The Movie
hi
i have a problem with the galleries that i'm building for this:
http://www.bigredbutton.tv/digby7/
site. if you go inside to the sections within the 'portfolio' section you'll see galleries with thumbnail images. if you browse for a while and move the mouse around suddenly the whole gallery will reset itself to its beginning image/thumbnail position. no idea why this is happening -- any ideas?
emma.
Resetting Movie
Is there a way I can have a movie reset and go to frame 1 (as though it were just loaded into the browser)? I'm having problems when I simply gotoAndPlay(1) - is there a way I can just 'wipe the slate clean' so to speak and start from the beginning again when a button is clicked?
Resetting The Whole Movie
I'm wondering if there is a nice easy way to call a function that will essentially act the same way as closing the .swf and opening again... except without actually having to do so. I need to make a program that handles a lot of data clear all of the data and just load fresh upon hitting a button. I could make a function myself that clears everything, but that probably will leave a bunch of junk in the memory. Is there a nice function call to reload? Please say yes :-)
Resetting All Variables In A Movie
Hi
Is there a command which can allow you to reset all variables to 0 at once in action script? I'm creating a game, and in order to start again, I need to be able to reset all the variables. Some of them are nested in seperate movie clips and I don't want the hassel of starting them all again.
Any ideas?
Thanks
Noel
Resetting ALL Variables In A Movie...
I know from asking this before you can't purge all variables so the only way to do this is go through them one by one:
var1 = undefined;
var2 = undefined;
//zzzzzzzzz - 2 hours later!
var657 = undefined;
What I'd like to is there anyway of getting a list of all variables?
I must have at least 200 in my movie theres no way I can remember them all.
Resetting Movie Clips
Hi
I am developing an application that contains a map at 3 different levels, with each level a movieclip. The majority of it's functionality seems to work apart from when I try to reset the application to its original state. The problem is the properties of the movieclips do not reset, e.g area of map clicked not restored to its original.
The application is at the following link, clip onto a region then press reset and you'll see what i'm trying to explain.
http://62.204.33.177/ash/ash_test2.html
Any help would be much appreciated
Thanks
Dave
Resetting A Movie Clip?
how can i reset a movie clip so it will behave as if it has only just appeared on the frame again?
i know the unloadMovie(); command, can i do that and then simply load it again? if so how?
Resetting An Entire Movie
i made a game with jillions of variables and functions that are difficult to reset, i want to put in a try again button for when you die or finish the game but its proving too difficult, some bits of my code just arent built to be run more than once.
is there some kinda command to reset an entire movie, and have it play from the begining as if its the first time its ever loaded? what would you recommend if not?
Resetting A Movie Clip
Hey Guys
How would one reset a movie clip? I'm working w/ a map that's going to pan , zoom etc. I'd like to reset the map_mc to its original location when the user wants to start over fresh .
THank U !!
ps. i've been searching through threads & i can't find anything.
Button Keeps Resetting Whole Movie?
I am using this code
Code:
stop();
more_btn.addEventListener(MouseEvent.MOUSE_DOWN, more_btnHandler1);
function more_btnHandler1(event:MouseEvent):void
{
gotoAndStop(frame#);
}
When i click the button i made to go forward it goes forward.
Then when i click a back button i made it goes back to the frame my action script tells it 2
at the same time below the content that it goes back to it shows the beginning of my time line starting with my intro animation. It also does it when you click on any other button that changes whats on the screen to new content. what do i do to get it to just go back to the frame number and not start all over again
Help me out as soon as possible please!
Problem With Movie Clip Resetting Itself
[ I've had a hard time trying to find any information on this by searching - the keywords are so generic, I get a lot of results but nothing that answers my question. ]
I'm working on a website design and can't figure something out...
I have a movie-clip object in my root timeline - a slide-out menu. The root tweens the clip into place, then the clip becomes active (via some crafty variable coding on my part). Mouseover will slide out the menu, mouseout will close it. Clicking on a menu item will jump down the clip timeline to play a different ending (one without a layer becoming opaque, but the menu still rolls up).
When there's a click, once the clip hits its end frame, there's 2 actions - a stop action and a _root.gotoandplay action for the root to then tween the clip over to the side.
My problem is that when the root tweens the clip, the clip doesn't stay at its end stop frame, it seems to reset itself to frame 1.
Why is it resetting itself? In theory, if I set the menu-open as the last frame of that clip, shouldn't it stay open when the command is sent to the root for it to perform the tween? Or is it the keyframe resetting the movie clip object (which is instance-named)?
I can provide more details if needed - or even post the site.
Resetting Movie Clip Or Restart Classes?
Hey!
I have a movie clip with various buttons on which run various functions from classes. One of which is a button that starts a slideshow of images.
the problem is, when i use other buttons to put things onto stage the last function which is running is still there, for example i am loading a calender onto the stage using one button, and then if i start the slideshow it will go over the top of the calender and everything just overlaps.
I was just wondering whether there is code to either;
a) a function which can be put onto a button to restart the fla file back to its original state, or
b) restart the function from the class runing
this button goes forward through the photos:
b6_btn.onRelease = function() {
var currentPhoto:Photo = mySlideShow.nextPhoto();
myImgLoader.loadImage(currentPhoto.getFileName());
title_txt.text = currentPhoto.getTitle();
desc_txt.text = currentPhoto.getDesc();
};
is there anything to put where the ****'s are to get the photo off the stage or restart the fla?
exit.onPress=function(){
***********
}
thankyou for any help or ideas,
MX2004: FPS Keeps Automatically Resetting In Simple Fade In Movie
Am I just missing something?
I am trying to simply create a fade in so my picture fades in and stays. I set the frame rate to 40 fps, but when I hit play it randomly changes many times throughout the movie and settles at 2.7 fps. It's only one layer, one picture, fades in for 15 frames. I want it to take about a quarter of a second. Fade in and stay...not too difficult, right? So why, when I hit play, does the frame rate jump around on it's own, and it end up taking over 5 seconds to play 15 frames? Am I missing something or just being stupid?
I am not experienced with flash, so any help appreciated
Resetting
How do I reset a movieclip after it passes a certain Y axis position back to its original position before it moved?
Thanks
Resetting A Var
Frame one contains this:
Code:
XML.prototype.ignoreWhite=true;
oXML = new XML();
oXML.onLoad=function(){
buildVariables(this);
}
buildVariables=function(oXML){
for (var oNode in oXML.childNodes){
if (oXML.childNodes[oNode].nodeType==1)
buildVariables(oXML.childNodes[oNode]);
else
_root[oXML.nodeName]=oXML.childNodes[oNode].nodeValue;
}
}
oXML.load("http://stats.planetsidegaming.com/15/273380/stats2.xml");
Frame 2 contains this but it does not work.
Code:
//To filter ANT
if (certification8 == "Advanced Nanite Transporter"){
certification8 = "ANT";
}
Later in the .fla I have to use _root.certification8 but I've tried that here and it does not work either. How do I reset the var to return "ANT" later as opposed to "Advanced Nanite Transporter"?
Thank you kindly,
Herk
Resetting MC's
I have a movie clip called "enemies" and with in it are several other movie clips of the enemies in my level that I have drug onto the stage. Each enemy has a script that tells it to move (ie. _x = _x + 8). Well, when the player dies, I want the enemies to reset back to their original positions (without restarting the whole scene). Is there a simple way to do this, or do I have to keep a list of all their original positions?
Resetting A MC
I basically have 3 MC's submarine, cursor, and ocean clip.
Basically the problem I'm having is that after you destroy the sub it sinks to the bottom and doesn't reset. And when I alter the code a bit to do a "_root.submarine.gotoAndPlay(1);" the sub plays again but stays at the bottom instead of being set to the middle of the stage again.
Can anyone help me with this please?
Thank you.
1.) Submarine
ActionScript Code:
onClipEvent (enterFrame) {
if (_x<345 and !_root.attached) {
_root.attached = true;
_root.sonarSound();
}
if (!_root.sunk) {
_x -= 8;
_y += vd;
if (_x<-100) {
_x = 400;
vd *= -1;
gotoAndStop(1);
}
} else if (!_root.sink) {
if (random(2)) {
rot = 1;
} else {
rot = -1;
}
_root.sink = true;
_root.stopSonarSound();
}
if (_root.sink and !_root.shook) {
_x -= 3;
_y += 4;
_rotation += rot;
if (_y>240) {
_root.ocean.play();
_root.shook = true;
}
}
}
onClipEvent (load) {
x = _x;
y = _y;
r = _rotation;
vd = 1;
}
2.) The Mouse Cursor
ActionScript Code:
onClipEvent (mouseMove) {
_x = _root._xmouse;
_y = _root._ymouse;
updateAfterEvent();
}
onClipEvent (load) {
Mouse.hide();
}
onClipEvent (mouseDown) {
if (!_root.shooting) {
_root.shooting = true;
_root.explosion._x = _root._xmouse;
_root.explosion._y = _root._ymouse;
_root.explosion.gotoAndPlay(1);
_root.blastSound();
if (_root.submarine.hitTest(_root._xmouse, _root._ymouse, true) and !_root.sunk and _root.submarine._x>0 and _root.submarine._x<300) {
if (_root.submarine._currentframe == (_root.submarine._totalframes-1)) {
_root.sunk = true;
_root.submarine.nextFrame();
} else {
_root.submarine.nextFrame();
}
}
}
}
3.) The Ocean
ActionScript Code:
_root.sunk = false;
_root.shook = false;
_root.congrats.gotoAndStop(1);
_root.submarine.play(1);
Help With Resetting
To help me with learning to program AS3 (I'm a complete newb), I am making a photo album with a button that rotates the images. The problem I'm having is, the button's numbered click event is repeated so it I get a warning about a duplicate:
stop();
hb_btn.addEventListener(MouseEvent.CLICK, click1)
hb2_btn.addEventListener(MouseEvent.CLICK, click2)
hb3_btn.addEventListener(MouseEvent.CLICK, click3)
hb4_btn.addEventListener(MouseEvent.CLICK, click4)
function click1 (evt) {
var url = "http://www.URL1.com"
navigateToURL(new URLRequest(url))
}
function click2 (evt) {
var url = "http://www.URL2.com"
navigateToURL(new URLRequest(url))
}
function click3 (evt) {
var url = "http://www.URL3.com"
navigateToURL(new URLRequest(url))
}
function click4 (evt) {
gotoAndPlay (47)
}
Frame 47 rotates the images and stops with this code:
stop();
hb_btn.addEventListener(MouseEvent.CLICK, click1)
hb2_btn.addEventListener(MouseEvent.CLICK, click2)
hb3_btn.addEventListener(MouseEvent.CLICK, click3)
hb4_btn.addEventListener(MouseEvent.CLICK, click4)
function click1 (evt) {
var url = "http://www.URL4.com/"
navigateToURL(new URLRequest(url))
}
function click2 (evt) {
var url = "http://www.URL5.com"
navigateToURL(new URLRequest(url))
}
function click3 (evt) {
var url = "http://www.URL6.com/"
navigateToURL(new URLRequest(url))
}
function click4 (evt) {
gotoAndPlay (54)
}
So, because of the duplicate error, I gave each new set a new set of click event numbers. That fixed the error. Problem was, when I loop back to the beginning from the end frame, it won't play and just loops the last frame.
What I need to do is find a way to reset the numbered click event so I can reuse the click1, click2, click3 and click4. Is there a way to reset the value so I can reuse it?
Resetting A .swf
I have a large .swf that dynamically loads other .swf onto the stage. Once these smaller clips are finished, I'd like to "replay" them. Here's the problems though: Cannot just _root.gotoAndPlay(1) because I have actionscript tweens that aren't reset by setting the timeline. Also, I have locked the root down, so I don't know if I can simply tell the larger .swf to just re-load the smaller ones.
Resetting Variables
Okay to anyone who can help, here is the deal. I have a main swf file that i use as a template for a flash course. Now this template has a series of buttons that control the course, like play pause and all that. It also has a replay button. Here is the tricky part though, the actual course files are other swfs that load underneath the main swf with the buttons. These files contain text box question and answer problems, but i since there is a replay button on the main swf, this causes a problem cause now if i type in an answer and hit replay the text box answer remains. How can i make it so that i can set the variables to reset when i hit the replay button. Note once again that the replay button is in another swf in another level.
This sounds more complicated than it really is, i know.
Thanks
Resetting Variables
Hi guys,
Quick question ...
If on drag and drop detection, I am setting the variables of various MC's , how ... when I replay the animation (via a button saying replay - not manually), do I reset the mc's variables back to the original state?
Thanks.
Adele
Resetting Variables
Is there any simple little command in flash that will reset all variables in the movie?
If so, what is it?
Variable Resetting
Is there a way to reset the values of all the variables in a movie at once? In the movie I'm working with everything starts out blank, so it wouldn't seem too difficult assuming I can access all the variables with one statement.
Resetting GetTimer ?
I'm using getTimer(); in a countdown. When it reaches 0, it goes to a 'end game' scene. In this scene there is a button to play again, which uses gotoAndPlay (Scene 1,1) to start again.. but the countdown now starts from 0, going to -1, -2 etc.
Does getTimer() find the elapsed time of a MOVIE ? I thought so, so replaced "gotoAndPlay (Scene 1,1)" with:
unloadMovieNum (0);
loadMovieNum ("04cardriver6.swf", 0);
which I thought would work, but doesn't...
Does this mean getTimer() uses the elapsed timne of the opening of the FLASH PLAYER?
Resetting A Scrollbar
Hey all
I have a guestbook with a dynamic text box with a scrollbar and scroll up/down buttons in an MC. The guestbook is set to display 5 entries at a time, there are buttons for next/previous 5 entries also. A user can scroll up/down thru the current 5 entries using the scroll up/down btns or the scrollbar. The problem is when the user clicks for the next 5 entries and they are displayed in the text box, the scrollbar does NOT jump back to the top. But if you click the down btn it jumps to the top before starting to scroll down. I would like the scrollbar to reset to the top when the user first clicks for the next/previous 5 entries. This is the script attached to the MC:
onClipEvent (load){
scrolling = 0;
frameCounter = 1;
speedFactor = 3;
numLines = 7;
origHeight = scrollbar._height;
origX = scrollbar._x;
needInit = false;
function initScrollbar(){
var totalLines = numLines + GuestBook.maxscroll - 1;
scrollbar._yscale = 100*(numLines)/totalLines;
deltaHeight = origHeight - scrollbar._height;
lineHeight = deltaHeight/(GuestBook.maxScroll - 1);
}
function updateScrollBarPos(){
scrollbar._y = lineHeight*(GuestBook.scroll - 1);
}
}
onClipEvent (enterFrame){
if( needInit ){
if(GuestBook.maxscroll > 1){
initScrollbar();
needInit = false;
}
}
if( frameCounter % speedFactor == 0){
if( scrolling == "up" && GuestBook.scroll > 1){
GuestBook.scroll--;
updateScrollBarPos();
}
else if( scrolling == "down" && GuestBook.scroll < GuestBook.maxscroll){
GuestBook.scroll++;
updateScrollBarPos();
}
frameCounter = 0;
}
frameCounter++;
}
onClipEvent (mouseDown){
if(up.hitTest(_root._xmouse,_root._ymouse)){
scrolling = "up";
frameCounter = speedFactor;
up.gotoAndStop(2);
}
if(down.hitTest(_root._xmouse,_root._ymouse)){
scrolling = "down";
frameCounter = speedFactor;
down.gotoAndStop(2);
}
if(scrollbar.hitTest(_root._xmouse,_root._ymouse)) {
scrollbar.startDrag(0,origX,deltaHeight,origX);
scrolling = "scrollbar";
}
updateAfterEvent();
}
onClipEvent (mouseUp){
scrolling = 0;
up.gotoAndStop(1);
down.gotoAndStop(1);
stopDrag();
updateAfterEvent();
}
onClipEvent (mouseMove){
if(scrolling == "scrollbar"){
GuestBook.scroll = Math.round((scrollbar._y)/lineHeight + 1);
}
updateAfterEvent();
}
onClipEvent (data){
needInit = true;
}
Any help with this is greatly appreciated. Thanks in advance. Much respect.
---
Bryce
phunkyphresh@hotmail.com
Resetting Variable
Hello,
I got a script wich is resetting a variable by itself?
The first trace(a); gives the correct value, the second one (in the tellTarget function) allways gives a zero. I'm getting desperate here
in an other function a is set to 1
topnav.contact.onRelease = function() {
if(a != 5){
if(a != 0){
trace(a);
tellTarget("nav" add a){
trace(a);
gotoAndPlay("nav" add a add "Back");
}
}
tellTarget("nav" add a){
gotoAndPlay("nav" add a "Start");
}
}
}
Thanks for reading!
Frans-Jan
Resetting MytextFormat.url ? ****
hello,
i'm working on a flash-text-editor but i have a problem when i want to use links (or mails) with (mytextformat.url)
i can set the url to a piece of text like:
mytextformat.url="http://www.url.com"
Does anyone know how i can reset this url ?
when i use "mytextformat.url=false" then the link is gone but i still see the "hand-cursor" over my text. Does anyone know how to get rid of this. It seems the link is empty and it links to an empty urlPage.
thanks!!!
Resetting MC _width ?
I'm trying to change an MC's _width with the following code:
Code:
mcpreload.loadBar._width = 1;
But I'm not having any luck. This code works on a previous line on my script:
Code:
mcpreload.loadBar._width = per * 2;
Is there another way to write this code? Or to 'reset' the loadBar mc's width back to it's original width size (1).
Thanks
Foochuck
Resetting An Mc's Posistion
I'm having a problem with something which would usually seem simple. I have a game with a few levels, and it's the game where you destroy blocks with a ball. Well the problem I'm having, is getting the ball and paddle to reset their posistion when the movie goes onto the next level. I have given my ball and paddle a keyframe on each level, which should be working already, but as it's not I decided to add:
Code:
this._x = 221.8;
this._y = 269;
that to the load event of my ball, but for some reason it still wont work! Could someone please help me out, thanks.
Resetting An EventListener
I've got an addEventListener attached to a mediaPlayback component and it needs to be reset so that the video that is being played can play again when the user goes back to it.
I am using cuepoints for the eventListener and everytime I return to the video after it has reached it's cue point nothing plays the second time around.
Here is the code I am using:
player1.removeAllCuePoints();
player1.addCuePoint("part2",23);
myObj=new Object();
myObj.cuePoint=function(p){
stopAllSounds();
gotoAndPlay("part2");
}
player1.addEventListener("cuePoint", myObj);
Player1 is the instance name of the MediaPlayback component.
Help would be greatly appreciated.
Resetting _x,_y,_ And Scale?
Hello All,
Long Long time lurker. Anywho, I know my way around mx alright for most things but when it comes to code it's all just annoying to me, but Im dying to become proficient in it. FlashKit and Kirupa have always been a great resources for me, and Ive searched through the posts, but everyone codes so differently I get confused.
My issue is simply resetting the _x,_y, and scale of a movie clip after it's been changed through AS. I am using loadMovie to load external SWF's then adjusting placement of the loaded movie through a submenu using actionscript. My issue is how to reset the _x,_y and scale to 0,0,100 when you select the next portfolio piece.
Attached you'll find my nasty test movie with horrid code any help getting this to work will be greatly apprieciated. The positioning isn't set exact in this file but you'll get the gist. If I wasn't a poor human being I'd offer money but as I have none all I can offer is an illustration or custom illustrated desktop to whoever can help this wanna-be.
Take Care,
ID
Resetting Gettimer
I'm using gettimer in a game to determine what some variables are set to. When the game is ended, I need to have gettimer reset to 0 and have the game restart. Restarting the game is easy enough, but how do I reset gettimer?
Thanks.
Resetting Rotations
I'm creating an animation for the mechanisms section on my website. - File attached. The top pulley is an MC which is supposed to turn 345 degrees clockwise in 24 frames however it now seems to be turning almost two full turns.
Is there a way of finding out out how much it turns in the length of the movie clip?
Is there a way of reseting the rotation?
TIA
www.flying-pig.co.uk
Resetting A Cookie?
I have a cookie which is set using AS, but is there a way of creating a reset. So I can reset the cookie with just a button.
Any suggestions would be appreciated.
Thanks.
Resetting X And Y Properties
Hello, wondering if you guys could help me out here, ill try to describe this as best as i can.
whats happening with my movie is i have 4 images loaded into 4 created MC's within a MC already created. then ive made a mask to be called from the library, and it applys itself to each MC.
now with the problem:
i have four buttons four images stacked ontop of each other. so the 1st image is showing say i want to see image four with out seeing two and three. i just click on btn 4 and it goes there. (so that works) however what ive done is ive told each MC to move away. what i want but dont know how to approach, is reset the _x cords of each MC, after theyre hit....
here my code, also ive provided a link to my swf to make it easier to understand what i mean. thank you everyone whom can help out!
http://www.teksunstudios.com/_misc_p...slideshow.html
PHP Code:
function moveImage(clipName, speed, xDist) {
clipName.onEnterFrame = function() {
this._x += (xDist-this._x)/speed;
if (Math.abs(xDist-this._x)<1) {
return;
}
};
}
//-------------BUTTON 01-------------
btn_01.onRollOver = function() {
this.gotoAndPlay("start");
};
btn_01.onRollOut = function() {
this.gotoAndPlay("end");
};
btn_01.onRelease = function() {
moveImage(img_hold.img_2, 10, -310);
moveImage(img_hold.img_1, 10, -310);
moveImage(img_hold.img_0, 10, -310);
};
//-------------BUTTON 02-------------
btn_02.onRollOver = function() {
this.gotoAndPlay("start");
};
btn_02.onRollOut = function() {
this.gotoAndPlay("end");
};
btn_02.onRelease = function() {
moveImage(img_hold.img_3, 10, -310);
moveImage(img_hold.img_1, 10, -310);
moveImage(img_hold.img_0, 10, -310);
};
MC Button Not Resetting...
Hey Folks,
I have a problem that has been driving me absolutely
nuts. I have a MovieClip that is acting like a button - it
has an on(release) action applied to it. When I press the
button, the action occurs, but in order for me to make 'it'
happen again, I must first move the mouse just a bit
before I click. If I don't move the mouse, nothing
happens when I click the button.
Let me clarify... Imagine a button that zooms in on a
picture each time it is clicked. Idealy, I would be able to
click twice really fast, and the picture would be zoomed
in twice. Not in this case. I click twice, and there is one
zoom. If I move the mouse slightly I can zoom in again.
Again, the MovieClip has an on(release) action.
Has anybody come across something similar to this?
It seems to me like the on(release) action is not being
released until I move the mouse.
I'd sure appreciate any assistance ya'll have.
Thanks.
Resetting Timer
I'm making a game with a timer that countsdown for 60 seconds. I want it to repeat because the game is about collecting resources once each minute, but everytime it goes back to frame 2, the seconds go down in intervals of 2 because the part in the code where the "time -= 1;" goes down by 1 each time the frame is revisited (first time: 60, 59, 58, 57, 56... |second time: 60, 58, 56, 54, 52... |third time: 60, 57, 54, 51, 48.. and so on)
Code:
stop();
setInterval(countdown, 1000);
time = 60;
function countdown() {
time -= 1;
if (time<=0) {
_root.wood += 25;
gotoAndPlay(2);
}
}
I've spent long hard hours working on this so help is much appreciated
[F8] Resetting Scroll Bar
I have been working on a project that has about 15 frames. Each frame has a photo and a scrolling text field. I have used the scroll bar component with these text fields. On a few of the frames - if you read to the bottom of the text and click to the next frame the scrollbar stays positioned at the bottom even though the text in the next field starts at the top. It doesn't happen on each frame though. Does anybody have any ideas?
[F8] Resetting Colors
I'm trying to get a map to highlight a user's zip code when they enter it into a textInput field. Once they enter it they click a component button and the zip code lights up. That all works fine.
My problem is that I can't get the colors to reset when a new zip is entered. The previous one stays lit up and the new one lights up as well.
Any help is appreciated,
Layne
Code:
function clicked() {
if (zipCode_ti.length == 5) {
//I thought keeping track of a previous zip and issuing it a different color before colorizing the next one would work. But it did not.
trace("Previous Zip = "+previousZip);//<-----Undefined, even on second click
var previousZipColor:Color = new Color(_root["z"+previousZip]);
previousZipColor.setRGB(0xDDDCCC);
var zipColor:Color = new Color(_root["z"+zipCode_ti.text]);
zipColor.setRGB(0xBF0000);
var previousZip:String = zipCode_ti.text;
trace("Current Zip = "+zipCode_ti.text);//<----This works fine
}
}
findZip_btn.addEventListener("click",clicked);
Resetting A Movieclip
Hello all,
I've got a menu and when clicking on a menu item the menu disappears and a movieclip opens. The user can do several things in this movieclip. When done there is a button that removes the movieclip and opens the menu again. Now when I open the movieclip again is still on the same frame as when it was closed. How can I reset the movieclip.
Thanks
Resetting My Variables
hey there. ive made a little thing where im clicking points for score, ive then let flash play a movie clip on a different frame and then at the end the app returns to frame 1. When i do this, if i have clicked on anything before hand it all resets to 0. How do i stop this from happening
[F8] My Boolean Is Resetting Anybody Know Why?
Hey guys I have the following code. For some reason the if statements are setting my 'myKey' boolean value to true every time. Any clues why? The intial trace works fine it shows both false and true so I know my previous code is working.
Code:
trace(myKey);
if (myKey=false){
gotoAndPlay("square");
trace(myKey);
}
if (myKey=true){
gotoAndPlay("circle");
trace(myKey);
}
Thank you!
[CS3] Resetting An Array
Hello,
I was wondering if there was any way to reset an array to no value? I got it at no value at the start of my program, but I can't get it to no value when pressing a button for example. I tried putting "myArray = null" but that didn't work too well. I also tried "myArray = new Array();" but that didn't reset it either. Do I have to splice all the values?
Thanks in advance!
Resetting A _rotation
Hey,
Im have an object roating back and forth and when I roll over a btn, Im wanting it to spin to its original state. Here is the code if anyone wouldnt mind taking a look that would be ideal! Also Im sorry if its a little messy... Im not the greatest writer yet.
PHP Code:
function btnName() {
var resetSpin = 10;
btn.onRollOver = function() {
globe.onEnterFrame = function() {
if (this._rotation == 90) {
resetSpin = -10;
//this._rotation == 0;
}
if (this._rotation == 0) {
resetSpin = 0;
}
this._rotation = this._rotation+resetSpin;
};
};
}
function globeSpin() {
var halfSpin = 1;
globe.onEnterFrame = function() {
if (this._rotation == 90) {
halfSpin = -1;
}
if (this._rotation == 0) {
halfSpin = 1;
}
this._rotation = this._rotation+halfSpin;
};
}
globeSpin();
btnName();
MC Resetting To Frame 1
Hey All,
The issue I am having is that I have a MC that in on the main scene. This MC is controlled by buttons which scroll it left and right. The MC also has buttons within the movie which, when pressed, jump the user to a different part of the main timeline.
Sounds simple, but the problem is that the MC is resetting back to frame 1 once the user clicks one of the buttons. I need that MC to stay on whatever frame the user ends it on, so when they return to the main scene, they don't have to scroll back to where they left off.
Thanks for your help!
Jeff
Hot Object Not Resetting
I created a quiz using the template. All my questions are using hot objects. The game works well but the hot object from the previous question stays on for the next question until the reset button is pressed. I have not changed any of the code.
When the next question is pressed, the previous hot object is still lite, the new answer has to be pressed but the 'Click on check answer is highlighted' . Then the reset button has to be pressed, a new answer picked and then check answer.
This happens for each question
Any ideas.
Help Please Resetting A Listener
Hi,
Im trying to create a game for my 1 year old in flash that shows a letter on the screen. He has to press that letter on the keyboard to move on to the next letter.
So far Ive got this...(for letter a)
Code:
stop ();
var myListener:Object = new Object();
myListener.onKeyDown = function() {
if (Key.getCode() == 65) {
play();
}
};
Key.addListener(myListener);
the problem is, when I get to letter b and put this...
Code:
stop ();
var myListener:Object = new Object();
myListener.onKeyDown = function() {
if (Key.getCode() == 66) {
play();
}
};
Key.addListener(myListener);
"a" still works. How can I make it so the listener, "resets" or "forgets" any previous letter?
Thanks!
Rich
Resetting Flash
I have a swf file that does several animations depending on keystrokes.
Is there a way to add a keystroke that essentially resets the flash animation?
ie: if for some reason the flash isn't running quite right, the user can hit
'reset' and the code reloads and gives you a fresh start.
|