ActionScript 2.0 :: Jump Back To Position 1 In NextImage()?
Dec 7, 2010
im working on an image gallery, its the one from kirupa (photogallery) the nextImage() function stops working when it has reached the last picture, but once it has reached the last picture and the user clicks 'next' i want it to start at the beginning again.
must be something like if (p == (total)) { p = 0;
Here is the current code.
function nextImage() {
if (p<(total-1)) {
p++;
if (loaded == filesize) {
[Code]....
View 3 Replies
Similar Posts:
Jun 15, 2010
I am brand new to scripting in Flash, and was hoping I could get some help on a question. I have an animation that is 300 frames long. The first 100 frames are an animated 'ad' (for lack of a better term), the second 100 frames are a different ad, and the third 100 frames are the last ad. This can be viewed straight from beginning to end (and is intended to loop if no action is taken), but I would also like to add some functionality to the animation, so that people can jump forward to the next ad, or back to the previous ad (hitting back from the first ad would take them to the third ad, and vice versa.)
[Code]...
This does not turn up any errors when I test the movie, but the functionality does not work. Am I anywhere near a working script, or am I attempting this in a completely wrong way?
View 3 Replies
Mar 29, 2010
I compiled two swfs into a single exe using a converter. Both swfs have the same 5 tabs for the 5 sections of my presentation. Swf A has all the stuff for the first 4 tabs, Swf B has the stuff for tab 5. When I start the exe & navigate all around in the first 4 tabs & their sub-sections, everything's fine. I can also click on tab 5 & the Swf B stuff starts playing right away & I can navigate all around in there.
BUT... After I've been clicking on the tab 5 stuff, if I click on any of the 4 tabs from Swf A it kicks me all the way back to the intro animation at the start of Swf A. What I need is to have it go to the first frame for each of those tabbed sections. (e.g. frame 5, 38, 93,...) I did gotoMovie & then gotoAndPlay & the frame number, but it sends me back to frame 1 anyway. How do I get it to go to the frame I want? This is in AS 2, by the way...
View 1 Replies
Jan 4, 2011
Question: I have an swf that is 1024x1600 and is embedded in an html doc. I have content on the bottom of this swf that when clicked should force the browser to jump back to the top of the html doc containing the swf. This is simple to do with anchors and links in html, but is it possible with AS3?
View 3 Replies
Oct 10, 2011
I have two embedded flv's in the timeline, one after the other. There are no errors in the video files. When the "playhead" in the exported swf comes to the end of the two combined videoclips, it jumps back to the first frame of the 2nd video clip for a fraction of a second, before playing from the start of the timeline as it is supposed to. I have explicitly done a "gotoandplay(1) in a separate action layer, at the last frame of the "movie", but that's not what happens.
View 0 Replies
Mar 4, 2008
so i have a main timeline and a nested one. the main timeline has a button named "how_btn" that plays the nested mc (named "how"). once i get into playing "how", i have a button named "menu" that i want to bring the user back to the main timeline (where the "how" button is). this is how i scripted:
how_btn.onRelease = function () {
gotoAndStop("how");
}
menu_btn.onRelease = function () {
gotoAndStop("nav");
}
the how button script works, however the menu button does not. is this b/c it's in a nested mc? i tried specifying the root, but that didn't do it either.
View 12 Replies
Jan 28, 2012
When landing on a certain frame, I'm trying to make a MC jump randomly either forward or back ONE frame in the timeline. Can't get random(whatever); to cooperate.
View 1 Replies
Jan 14, 2009
I have a HTML stageholder, this calls a "mainMenu.swf" which essentially controls my site. This "mainMenu.swf" has three buttons: intro, portfolio and contact which are all individual movies. So far, all good... When I have clicked into the portfolio section a 3x3 grid loads with nine buttons, one of these buttons loads a preview page for four movies, when I load one of these movies it plays fine. What is the path to get the loadMovie command to jump back to the 3x3 grid page from this movie? Basically, what is the command to jump up a directory when using loadMovie?
[Code]....
View 1 Replies
Apr 8, 2009
In realation to the following tutorial on [URL]
I was wondering if anyone can tel me how to do the following:
I have this xml gallery embeded on my webpage. Each time the page loads I want the xml gallery to jump to a random position and display the relevant information.
View 1 Replies
Dec 23, 2008
I have a custom video player that I built with AS3. When people are viewing the videos I want them to be able to jump ahead of their current download position so that they don't have to wait until the video downloads to watch that portion.
View 7 Replies
Sep 8, 2002
I'm working on a web menu, that has sub menus. I'm currently trying to get the sub menu to jump back to the main menu if the mouse is no longer inside the submenu zone.
It works if I move the mouse quickly to another part of the Flash area, but if I quickly move it out of the Flash area and onto say the html document, it doesn't update fast enough, and thus still thinks the mouse is hovering over it.
I know I can simply update the movie frame rate which does work, but I was wondering if there is any way to get Flash to check to see if the mouse IS ACTUALLY ACTIVE over it, and if not close the submenu?
View 4 Replies
Jan 30, 2012
I have a grid of letters. I want to create the else aspect, where if you don't drop the letter on any square, it'll return to its original position. Issue is I don't declare it's original position, i simply use placement on stage.
View 1 Replies
Jan 26, 2006
I want to make a movie clip move left continuously and smoothly on rollover then on rollout i want it to be able to move it back to its original position with an ease. The problem is getting it to remember the position it finished in on rollover. How can i do it with actionscript?
I want to do it all with actionscript because I did it with frame labels and tweens first of all but its not smooth enough, it jumps in certain points because it cant remember how far left it moved on the rollover.
View 4 Replies
Oct 28, 2003
I am trying to get this an object to go from position A to B and back, in infinity!!I only get the object to go from A to be B and then it stops. The code is in the MovieClip actions.
Here is the code..
onClipEvent (enterFrame) {
this.onEnterFrame=goRight;
goRight=function(){
if (this._y<250) this._y+=1;
else this.goLeft;
} goLeft=function() {
if (this._y>50) this._y-=1;
else this.goRight;
}}
View 2 Replies
Jul 29, 2010
I have a canvas with its verticalScrollPolicy = "auto" and whenever I reload data into the canvas I want to set the position of the scroll bar back to the top of the page.
View 1 Replies
Mar 10, 2010
Do you know how to rewind a tween. but I dont want it to just snap back to the beiginning. I want it to yoyo back to the beingining without actually yoyoing many times. you know what I mean?this is the code I have which make the beginning motion I want:
public function imageSelectR(e:MouseEvent):void {
myTween = new Tween(imageLoaderHost, "z", Regular.easeInOut, 0, -100, 1, true);
myTween.addEventListener(TweenEvent.MOTION_FINISH, imageSelectL);
[code]...
View 2 Replies
Apr 30, 2003
I'm playing around with mac os x-like dock in flash, but I've got a problem with it. I found this at flashkit.com, see it here. For your convenience i'll post the entire code below (it's quite long though).
Now what i want it to do: if the mouse is not 'on' the menu, i want the buttons to ease back to their original position instead of just spawning there. How can i do this via AS ? The _xscale and _yscale values should also ease back to original state.
Actions applied on the first (and only) frame:
[AS]startDrag ("_root.drag", true);
stop ();[/AS]
Actions applied on the control movieclip:
[AS]onClipEvent (load) {
function checkOffset (coffset) {
if (coffset<-175) {
[code]....
View 2 Replies
Jan 24, 2010
My code in theory works find but for some reason things aren't doing what they're supposed to. Basically I have all my draggable puzzle pieces as movieclips; they start at specific x's and y's on the axis. You drag them to the corresponding hitbox movieclip and it pops into the other specific x and y spot on the axis (otherwise they go back to the first xy spot).
The problem is sometimes the pieces drag and drop fine, but other times when you click the mouse down, they drag, but when you let go, they don't drop! Randomly! They just follow the cursor around, til you click a few times, and then randomly it will drop and not move (when it's supposed to go back to the original xy position).
[Code]...
View 1 Replies
Feb 2, 2009
I made two movie clips that follows the mouse but I want to put constraints on them, they should follow the mouse until the mouse reaches a certain distance and then the movie clip should pop back to its original x and y position.
Code:
private function init():void
{
addChild(backgrnd);
[code]....
View 1 Replies
Dec 11, 2010
I have a movie clip for each piece of clothing that will be used to attach on the dog. These movie clips click and drag to add clothes onto a target and it automatically resets back to its original position each time you grab a different selection of clothing. All of my objects go the original position except for one. The "julyDress" movie clip automatically pops up to the top of the page and does not reset to the original position.
Below is my code:
stop();
var startJulyXPos:Number = JulyDress.x;
var startJulyYPos:Number = JulyDress.y;
[Code]......
View 1 Replies
Oct 9, 2003
i've a little problem with my buttons wich are movieclips if you rol over and out to fast they stay "on" (they do not come back to initial position) i've used actions: rolover >goto and play frame 2there is a stop on frame 1 and 5rolout > goto and play frame 6 (so it plays to frame 9 and come back and stop on frame 1 :initial position)
View 4 Replies
Jan 15, 2009
Is there any way to make a clicked movie clip go to front, and then when released, go back to it's original position?
I've been reading about swapDepths and a few functions that allow to bring to front the MC, but nothing to return them to their original positions between the layers.
Can this be done? Or is it any way to make it look as it?
View 4 Replies
Oct 9, 2003
i've a little problem with my buttons wich are movieclips if you rol over and out to fast they stay "on" (they do not come back to initial position) i've used actions: rolover >goto and play frame 2 there is a stop on frame 1 and 5 rolout > goto and play frame 6 (so it plays to frame 9 and come back and stop on frame 1 :initial position) url...
View 4 Replies
Sep 26, 2010
I want to make a magic 8 ball in actionscript 3. I'd like to be able to click on the movie clip of the 8 ball, shake it with the mouse, and then have it snap back to its original position when I let go of the mouse button. I have three problems:
1) I can make the 8 ball track the mouse, that's easy, but how do I make it snap back to the original position when I let go of the mouse button?
2) I want to constrain the movement of the 8 ball movie clip so it won't go all over the stage, just enough to move it back and forth a bit.
3) How do I randomize output of answers in the 8 ball window...such as, "not now," "doesn't look good," or "yes" etc?
View 2 Replies
Jul 15, 2004
I have a block that I'm trying to make move from right to left, and if the block gets to a certain point, it will move back to it's original position. So, I have this on my block (movieclip) right now.
Code:
onClipEvent(enterFrame) {
speed = 3
dist = 8.5
_x -= speed;
if (_x = dist) {
_x += 3
}}
But all this is doing is throwing the block at the 8.5 distance...
View 9 Replies
Feb 4, 2005
drag and drop, basically say I got A movieclip called 'clipdrag'. the current position of the movie clip is _x=65, _y=51.
and the clipdrag movieclip is droped at say _x=200, _y=300. Bascally what i need to know is how i got about bring the clip back to its orangial position, i want to use a timer so that the user can see the clip moving back slowly.
View 4 Replies
Apr 3, 2008
I've got 3 pages each with their own portfolio loaded dynamically from an XML file. Everything is working great with the thumbnails i added using the "adding thumbnail" tutorial. There's only one quirk I can't figure out. If you've scrolled to the end of the thumbnails on the first portfolio, the scroller stays in the same place when you go to the next portfolio rather than reloading back at the beginning. I hope that makes sense because it's hard to explain, but the site is [URL] here's the partial code for the thumbnails...
[Code]...
View 1 Replies
Feb 27, 2010
I created a movie clip, an aircraft compass which rotates till the button is pressed but I would like it to return back to its original position in opposite direction of smooth rotation and stop. I already have the following script on the clip.
onClipEvent(enterframe) {
if(spin) {
_rotation -= 2;
[Code]....
View 2 Replies
Apr 19, 2004
how i could create a function to do the following. I have a mc and when you click on it i want it to scale too say 150% and move to a different x y position, then when you click on it again i want it to go back to its original size and position.
View 3 Replies
Feb 4, 2005
do a drag and drop, basically say I got A movieclip called 'clipdrag'. the current position of the movie clip is _x=65, _y=51.
and the clipdrag movieclip is droped at say _x=200, _y=300. Bascally what i need to know is how i got about bring the clip back to its orangial position, i want to use a timer so that the user can see the clip moving back slowly.
View 4 Replies