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








Changing Postision Based On Prev Position...


Ok...I have a button..what I want it to do is when the button is clicked I want MC#1 to be deleted and I want MC#2 to take its place. For the sake of an example. Lets say that MC#1 had a postion of 100x and 110y. and MC#2 is at 100x and 120y. So I want the button to more MC#2 to MC#1 position which is 100x and 110y. What code would I write?

Sorry if this is a stupid question but I'm a flash newbie.

Thanks for any help.
Moe




FlashKit > Flash Help > Flash ActionScript
Posted on: 09-17-2001, 07:52 PM


View Complete Forum Thread with Replies

Sponsored Links:

SoundChannel.position - Trouble Triggering Event Based On .position
I would like to trigger an addChild event when my mp3 reaches a certain point.

My trace statements will only fire if I use <= but not ==

The goal is to add text to the stage when the MP3 has reached one second, what am I missing?

Ultimately there will be several trigger marks I need to hit along the MP3.


ActionScript Code:
var buffer:SoundLoaderContext = new SoundLoaderContext(10000);var welcome:Sound = new Sound(new URLRequest("Intro.mp3"), buffer);var welcomesc:SoundChannel = welcome.play();addEventListener(Event.ENTER_FRAME, playMessage);function playMessage(event:Event):void{trace(Math.floor(welcomesc.position));if (welcomesc.position == 1000)    {        trace("NOW!!!!!!!");    }    else    {        trace("WAIT-------------");    }welcomesc.addEventListener(Event.SOUND_COMPLETE, soundComplete);}

View Replies !    View Related
Prev & Next Button Goes To Prev Or Next LABEL
I'm trying to make an interactive presentation reminiscent of powerpoint but I can't get the prev and next buttons to work. Here's what I have...

a MC with all the images (sudo slides). The timeline begins with a stop action on frame1. Each image has a 15-frame Alpha fade which has a frame label on the first frame and a stop action on the last frame (so frame label "img1" goes from frame2 to frame16 then stops, frame label "img2" goes from frame17 to frame 32 then stops, etc.)

Outside of that MC in the main timeline I have the buttons prevBtn and nextBtn. What I need to do is get those buttons to go to the next label.

I know I can do gotoAndPlay("img2"); but I want the button to go to the next frame label no matter what it's named.

I tried an array but I've never dealt with arrays before so I don't think I did it right. The code I have for the array is:

mylabels = new array("img1","img2","img3");
currentLabel = 0;

//Go to next label
gotoAndPlay(mylabels[(currentLabel + 1)]);

//Go to previous label
gotoAndPlay(mylabels[(currentLabel - 1)]);

I got this from someone else who was trying to help but I don't know where to put any of it or if it will even do what I need.

I've also tried to use the _currentFrame+15 or _currentFrame-15 but that doesn't work either. I only know a small amount of AS so I may have done that one wrong too....

Any help would be appreciated. (btw, i'm using AS2 and Flash CS3)

View Replies !    View Related
Efects Based On X/y Position
I have been trying to apply a function to a certain area of the screen, so that when you rollover a certain area, a function is applied. I have been attempting code such as:

Code:
if (x<100, y>200) {function};
but I can't seem to get it to work.
does anyone know how I can do this?

Thanks in advance!

View Replies !    View Related
Position Based On Rotation
Hey everyone. I am currently building a flash game based loosely on the concept of the "Albatross Overload" game made by Yeti Sports.

I figured the best way to accomplish the goal of movement was for the user to control the rotation of the object, while the y movement speed was determined by the angle the object is pointing, all while there is a constant force rotating the object down and pulling it down. (I.E., the more he is looking up the faster he will go upwards, etc)

The problem I am having is to find the actual angle that I can use. The first trial was I put two dot movie clips inside, the first being at the absolute center and the second at where the objects "looking". I would then make a triangle out of the two dots and figure out the angle from that.. but I have had no luck.

Anyone have suggestions?

View Replies !    View Related
MovieClips Position (not Based On X/Y)
Hello people

I'm writing an script that show a list of news like stock ticker. Working great runing right/left but the client want to add a button to change the direction to runing from (left or right).

I did it and run fine, but sometimes the movieclips get a wrong position. Is there a way to know the position for each moviclip ???

I need to know the position of the mc1, mc3, mc2 not based on his X/Y reference but if the mc2 is the first based on left to right or if mc3 is the second based on left to right too.

Here you will see the example that i did. The problem here is sometimes when i click the right button, some text get over the current one and with someting that let me know where is the objects i can fix that. Any idea ???

View Replies !    View Related
Position Of Mc (x,y) Based On External Var
Hi,

I'm kinda new in actionscript so I need your help on this. I'm trying to create a swf that gets vars (friend1;friend2;local1 and local2) from a txt file and insert it on the textboxs (instanced as box1_txt;box2_txt;local1_txt and local2_txt).

So far so good. I managed to do that with the folowing code:

myData = new LoadVars();
myData.onLoad = function(success){
if (success) {
box1_txt.htmlText = this.friend1;
box2_txt.htmlText = this.friend2;
local1_txt.htmlText = this.local1;
local2_txt.htmlText = this.local2;
}
}
else {
box1_txt.htmlText = "error loading variable";
box2_txt.htmlText = "error loading variable";
}
}
myData.load("example.txt");


But now I need to create 2 movieclips and its position (x,y) must change acording to the vars local1 and local2.
I must be doing something (completely) wrong. I tried to following code:


_root.circulo1_mc._visible = false;

if (local1_txt.htmlText == "Rome") {
circle_mc._visible = true;
circle_mc._x = 287.0;
circle_mc._y = 72.0;
}
else {
if (local1_txt.htmlText == "Sydney") {
circle_mc._visible = true;
circle_mc._x = 387.0;
circle_mc._y = 72.0;
}
else {


This code doesn't retrieve any error but it just doesn't work. I also tried to make the mc always visible but it's positions stays always the same.

Can someone help me with this?
Thx in advance.

View Replies !    View Related
Movement Based On Position
I am trying to move a movieclip based on its and another clips position on the stage. I have this so far, but it is not working. Is there a better way to do this or am I just missing a critical piece that is causing this to not work?
Code:

work_mc.onRelease = function():Void{
    if ((this._y = 442.4) && (firm_mc._y = 459.9)){
      new Tween(work_mc, "_y", Strong.easeOut, 442.4, 403.4, 1, true);
      work_mc.gotoAndStop(2);
   } else {
      new Tween(work_mc, "_y", Strong.easeOut, 442.4, 403.4, 1, true);
      work_mc.gotoAndStop(2);
      new Tween(firm_mc, "_y", Strong.easeOut, 403.4, 459.9, 1, true);
      firm_mc.gotoAndStop(1);
      }
};

View Replies !    View Related
Rotation Based On Mouse Position
I have started producing my second flash game... my first taught me alot but I've seen much better, and now I'm making my second. I have gotten everythign down up until this point. I checked the flashkit tutorials on how to rotate an object to follow the mouse pointer but it doesn't work at ALL, in my game at least. here is the coding for calculating it, and yes al lof the variables ARE correct:


Code:
a = _root.Player._y-_ymouse;
b = _root.Player._x-_xmouse;
angleA = Math.atan2(a, b);
degrees = angleA/(Math.pi/180);
_root.Arm._rotation = degrees;

Since the Arm follows the player's coords exactly, using a = _root.Player._y-ymouse and a = _root.Arm._y-ymouse would be the same.

First of all, when I move the mouse, the arm doesnt get CLOSE to following my mouse. It moves around in a small area, maybe a 50 degree span.

Secondly, when my player moves, the arm aims lower as i move.

If anyone could help me so that the arm aims at the mouse it would be very, very much appreciated. If for some reason you need my whole player/arm script here it is:


Code:
onClipEvent (enterFrame) {
_root.Arm._x = this._x;
_root.Arm._y = this._y;
if (Key.isDown(68)) {
if (this._currentframe == 16) {
gotoAndStop(1);
} else {
this.nextFrame();
}
this._x = this._x + 5;
this._xscale = "100";
} else if (Key.isDown(65)) {
if (this._currentframe == 16) {
gotoAndStop(1);
} else {
this.nextFrame();
}
this._xscale = "-100";
this._x = this._x - 5;
}
a = _root.Player._y-_ymouse;
b = _root.Player._x-_xmouse;
angleA = Math.atan2(a, b);
degrees = angleA/(Math.pi/180);
_root.Arm._rotation = degrees;
}

View Replies !    View Related
Movieclip Size Based On Position
Hi,

I have created a game where you can drag characters onto a background to make a scene.

What i would like to be able to do is make it so the movieclip being dragged changes size based on is position on the background.

for simplicity sake, the higher up on the background the character, the smaller it gets (to give the illusion of distance and proportion)

Thanks

View Replies !    View Related
Movieclip Position Based On Variables
My flash movie connects to a PHP file which sends results from a database separated by comma's. ie: 5,47,1825,

I want flash to place a copy of the movieclip on to the stage based on the figures above. The movie clip is called "takensquare". The calculation for the placement of the movieclip is quite complex but I can do that myself. For the sake of this thread I'll simplify it to the following:

Does anyone how would I make the x position of the movieclip match the results in php file?
ie: if php file outputs 5,47,1825, then I would want flash to generate 3 copies of the movieclip with the x position on 5 for the first, 47 for the second and 1825 for the third.

Any help appreciated

View Replies !    View Related
[CS3] Move An MC Based On Mouse Position
I have an MC to the left of the stage. When the mouse moves past a certain point to the left. I want the MC to move to the right and then stop at a certain point. When I move the mouse back past the same point I want the MC to move back to its previous position. I only want the MC to move on the X axis. Any ideas or tutorials would be VERY HELPFUL!

Thanks again my fellow FKers (no pun intended...) lol...

NOTE: I'm scripting this in AS2 NOT AS3

View Replies !    View Related
How To Get These MC To Slide Based On Mouse Position
Ok, the code that is in the first frame of the AS shows how the MC's slide... only problem is, I cant get them to slide correctly... here is what I want:

if you see the layer called gallery bar, I only want you to be able to move the thumbnails when the mouse is in this area.

When sliding, I want to stop the slide when the last movie clip is visible. make sense?

below is my .fla
I cant show you an example because my servers ftp are down... so that will have to wait...

Please Help! Thanks in advance
ZG

View Replies !    View Related
Position Based Frame Control
Hello all...

I have a slider at the bottom of my screen that I can grab. I want this slider to control where in time the movie is.

I am trying to set it up so the frame of the flash movie will be derived from the X position of the that slider. The problem I have is that I have been unable to find the syntax to set current frame of the whole project.

Any help would be greatly appreciated... or if anyone knows a better way to achieve this... that would work too.

Thanks,
J

View Replies !    View Related
Fucntion Based On Mouse Position
This is just plain stupid on my part as I had a script that did this once upon a time. I have a menu that autohides itself if not needed. Basically if the mouse y gets beyond 500 I want it to appear and if it gets behing 350 I want it to hide. (On another note, I'd love to delay the hide by about 2 seconds as well).

Not sure whats wrong with this.


Code:
onClipEvent (mouseMove) {
if (_ymouse>500) {
showMenu();
}
if (_ymouse <350) {
hideMenu();
}
}
Any help would be great!

View Replies !    View Related
Trigger MovieClip Based On Position
I have a tweening movie clip symbol (Object_1) that moves from left to right across the screen.

I have multiple instances of Object_2 (also a movie clip symbol) scattered on the same horizontal line (at different X-positions).

I want the Object_2 instances to be triggered individually when Object_1 approaches (i.e. Object_1._x = Object_2._x

Does anyone have some words of wisdom?

View Replies !    View Related
Mouse Position Based Alpha
The script is little buggy and cant seem to figure it out. When I mouse over set boundary of x,y, mouse position triggers easing alpha from 0 to 100%.
Following bugs seems to happen:
- On continuous mouse over with in that position, it fades away on its own and ceases to work until i go in and out of that area repeatedly.
- On mouse out, there is a pause that depends on how long I have I have it mouse over.
- Sometimes, after mouse over, it doesnt fade away on mouse out.

I have made the links absolute so i could control multiple movie. And with in these movies, there are buttons that has its own separate actions (loadmovie).
take a look at the script and let me know of any suggestions. Thank you
----------
speed = 30;

testmovie.onEnterFrame = function() {
if (_root._xmouse>20 && _root._xmouse<150 && _root._ymouse>290 && _root._ymouse<327) {
testmovie._alpha += speed;
} else if (testmovie._alpha>0) {
testmovie._alpha -= speed;
}
};





























Edited: 12/17/2006 at 08:30:52 PM by jifjif06

View Replies !    View Related
Scrolling Based On Mouse Position
Hi,

check out: http://www.furax.ca - great site

Does anyone know how this scrolling based on mouse position works?

thanks

ash

View Replies !    View Related
Movement Based On Position On Stage
I am trying to move a movieclip based on its and another clips position on the stage. I have this so far, but it is not working. Is there a better way to do this or am I just missing a critical piece that is causing this to not work?

ActionScript Code:
work_mc.onRelease = function():Void{
    if ((this._y = 442.4) && (firm_mc._y = 459.9)){
      new Tween(work_mc, "_y", Strong.easeOut, 442.4, 403.4, 1, true);
      work_mc.gotoAndStop(2);
   } else {
      new Tween(work_mc, "_y", Strong.easeOut, 442.4, 403.4, 1, true);
      work_mc.gotoAndStop(2);
      new Tween(firm_mc, "_y", Strong.easeOut, 403.4, 459.9, 1, true);
      firm_mc.gotoAndStop(1);
      }
};

View Replies !    View Related
MC Rotation Based On Mouse Position?
I have a character that I would like to rotate 360 degrees based on the position of the mouse cursor so that the character, a movieclip, will be facing the cursor at all times. The movement needs to be in realtime and as smooth as possible. The character is for use in a game. I have been having a lot of trouble with this one. What would the best way to code this?

View Replies !    View Related
Position A Graphic Based On Point Clicked
I hope someone can help me with this.

I am trying to figure out a way to position a graphic by clicking at a point on the screen.

Picture a circle on the left side of the screen. I want to click on the screen and have the circle move to and stop at that point, and thereafter move to another point from it's previous position when I click again.

Any ideas?

Thanks in advance!

View Replies !    View Related
How Can I Trigger An Action Based On A Mouse's Position?
Seemed simple to me, but hasn't been the case, but my be simple for a script whiz:

How can I trigger an action that is dependent on a mouse's position? My scenerio involves a mouse being either IN or OUT of an odd-shaped area. I need an automatic trigger to say "hey, the mouse has left area 'X', so do action 'y'"
*also important, that it can work while the mouse is in html land, not even over the swf

(its a long story, but basically, cant use a simple rollover)

Flash help says:
The following example uses hitTest with the x_mouse and y_mouse properties to determine whether the mouse is over the target's bounding box:

if (hitTest( _root._xmouse, _root._ymouse, false));

huh? is that a typo? should it be:
(anyMovieClip.hitTest( _root._xmouse, _root._ymouse, false));

I don't understand where it refers to any MC.

Help!!?!

--------------------------------------------

If you are really wondering why I cant use a rollover, here is the long story:

I have a menu with main categories, and subcategories.

it is in a typical "Filing Tab" look and feel. So, the user rolls over a tab, to reveal subcategory buttons on the lower part of tab; in other words, bring that category's tab to the front.

So, once the mouse rolls over the main category tab, a MC moves to position where that particual tab is at the front, so now you can roll over the subcategories. if they roll out of the "Tab area", I need a way to instruct the MC to return to whatever tab it came from.

BOTTOM LINE IS, the mouse has left a particular area in the swf, and I need a way for this to be "caught", so I can assign an action.

I placed a "hidden" button on the outer boundaries, and used the MouseOver event, but if the mouse rolls to quickly off the swf into html-land, it doesn't catch the mouseover event, and trigger the return.
[Edited by cmoseman on 01-05-2002 at 08:00 PM]

View Replies !    View Related
Sliding An Object Based On Mouse X/y Position?
I have an 800 pixel wide stage. There is a sliding strip that moves across it based on the position of the mouse (left/right) and speeds up as you get closer to the edges and slows as the cursor near the middle of the stage. This is all OK. The objects action code for the sliding strip that works it is this ...

onClipEvent(load) {
nScreenWidth = 800;
nMaxRate = 15;
// nPixels determines the speed of the slider movement
function moveLeft(nPixels) {
this._x -= nPixels;
if (this._x < -4803) {
this._x = -924;
}
}
function moveRight(nPixels) {
this._x += nPixels;
if (this._x > 369) {
this._x = -3510;
}
}
}

onClipEvent(enterFrame) {
// move slider with speed dependent on mouse position
if (_root._xmouse < nScreenWidth/2 && _root._xmouse > 0) {
moveRight(nMaxRate - _root._xmouse * nMaxRate/(nScreenWidth/2));
} else {
if (_root._xmouse > nScreenWidth/2 && _root._xmouse < nScreenWidth) {
moveLeft(_root._xmouse * nMaxRate/(nScreenWidth/2) - nMaxRate);
}
}
}

So far, so good. But what if I want to move the sliding piece when the mouse is only over a certain area of the screen (say, the right 400 pixels) and not the whole 800 pixel wide area.

Can you make an invisible button on the same frame as the sliding piece that is only on the right half of the screen and key the sliders object action to the mouse being over the button's area rather than mouse over the whole screen?

Many many thanks in advance to all ...

David JJ
janikjones@NOSPAMREMOVEsympatico.ca

View Replies !    View Related
How To Restrict Input Text Based On Position?
Input text fields have a maxlength.
Input text fields have a restrict option so it's possible to block certain characters.
I would like to restrict input based on the caret's position in the textfield. Is this possible?
I'm able to retrieve the caret's position in the onChanged handler.
Can I clear the buffer in the onKeyDown?

Btw, the object I'm trying to put together is a textarea with one or more input fields inside. So, it's static text, followed by input text, followed by static text, etc.
My first try came down to putting textfields on top of each other, set autosize to true, and expand the static part along with the input part with an onchanged handler. Too bad this only works for one line of text. With more lines, wrapping becomes an issue.

Suggestions are most welcome.

---

Just thought of something. Is the textfield listening to the Key object? If so, can I detach it, and create my own handler especially for my textfield?

View Replies !    View Related
MC Frame Change Based On Slider Position
Hi guys,

I'm trying to make this thing that basically acts as a video 'scrub' - fast forwarding and rewinding the video depending on a bit of user interaction, in this case the movement of a slider bar - and despite the fact that its probably been done a million times, I can't find any examples of how its done.

I guess the easiest way to do it would be to put each frame of the video onto a frame inside a movieclip, and then have the slider control the playback of that movieclip, but, ah i dunno, maybe i'm searching with the wrong words.

Any suggestions on how this could be done would be greatly appreciated... am tearing my hair out here!

cheers,
md

View Replies !    View Related
Move Movieclip Based On Mouse Position
I have 26 (all the same) square movieclips all lined up horizontally. I want to have it so when you move the mouse left to right they move upwards based on how close you are to each specific movieclip. For example, if I am right on top of one of the movieclips it would go upwards on the y-axis 30 pixels, each one to the left and right of that one would go upwards 20 pixels, each one to the right and left of that 10 pixels, and each one to the left and right of that would go upwards 0 pixels.

It doesn't necessarily have to be exact distances though. I just want the maximum distance (if you are right on top of the clip) to be 30 pixels that it would go upwards. The rest of the clips on down the line on each side can just be percentages based on how far away they are from the mouse.

I was also wondering if it is possible only to have these actions happen when the mouse is within the rectangle of 240-270px on the y-axis and 0-750px on the x-axis.

Please help. I have been trying all kinds of different methods and they don't work. Thanks for any help anyone can give me. I need to figure this out!

-- K

View Replies !    View Related
Movieclip Scale Based On Mouse Position
Hi guys, I'm working an OSX dock style menu. One where the item your touching grows to a certain size and the adjoining items blend their sizes. It's a verticle version btw. I'd like only the 2 nearest buttons above and below to blend

It's looking good but I'm having trouble figuring out the math that will force the buttons scale to be inbetween %100 and %200.

I want it so that when there is zero distance between the mouse and the button (rolled over the button), the button grows to %200 and as the mouse moves away it shrinks back to %100.

I'll post the code I'm using atm if you want but I don't think it's the best way.

View Replies !    View Related
Moving Background Based On Mouse Position
hi...true newb here. could someone please tell me or atleast point me to a tutorial on how to achieve the effect where when you move your mouse to the right or left the background moves to the right or left? for a perfect example of what im looking for check out http://www.teamsleep.com thanks a lot in advance for anyone who can help.

View Replies !    View Related
[MX04] Proper Scaling Based On Y Position?
hey i've got a (hopefully) simple question...
i'm trying to scale an mc based on it's Y position so it has a proper size for different "heights" in the movie but it doesn't work properly

the character should have the size the pointers show at that height to be able to fit through the doors but i can't figure out how to scale him properly so he fits into all doors and has 100% height at the bottom of the movie

here is my .swf to check it out:

you can move the player with the arrow keys
http://ize.badne.ws/stuff/properScaling.swf

and here the fla:

http://ize.badne.ws/stuff/properScaling.fla

the code is on the character mc

View Replies !    View Related
[F8] Mouse Position-based Scrolling Menu
Hello!

I am searching, searching for a Mouse position-based scrolling menu.

You can find an example of what I mean here : http://www.userenabled.com/downloads/rssfeeder/

I am referring to the active menu on the right, in the RSS feeder, below "Sample Feeds".

A concise tutorial would be very helpful!

Thanks!

View Replies !    View Related
[CS3] Playing Sound Based On Mouse Position
Hello there,

I have created a document 600x300 filled with buttons for a rollover effect. I want to be able to play sounds dependant on the x and y position of the mouse without having to use objects that interfere with the buttons. I have heard that this is possible, yet I cant seem to find anywhere that I can learn how to do this.

Does anyone know how I could go about this?

Cheers

PP

View Replies !    View Related
Goto Frame Based On Mouse Position
Hi..
I have a movie clip(instance:carousel) with 200 frame animation. I want it so that when mouse is on left side of the stage, carousel.prevFrame() and when its on the right side of the stage, carousel.nextFrame().
All works well with my code, but i would like to push this a bit further and add when mouse is further away from stage.center, it animates faster, skipping more frames and when its closer to the center, slows down and do nextFrame(). How could i achieve this effect?

my newbie code:

Code:
center = Stage.width/2;
_root.onEnterFrame = function() {
if (_root._xmouse<center) {
carousel.prevFrame();
if (carousel._currentframe == 1) {
carousel.gotoAndStop("end");
}
} else {
carousel.nextFrame();
if (carousel._currentframe == carousel._totalframes) {
carousel.gotoAndStop(1);
}
}
};

View Replies !    View Related
MovieClip Control Based On Mouse Position
I was wondering if anyone could help me with a way to make a movie clip play based on the position of the mouse.

I'm working with an isometric view point sprite, and i want it to to animate based on the position of the mouse. if the mouse is at the top of the screen then play the North facing frames, if the screen is in the north east part of the screen play the frame swere the sprite is facing the NE

Thanks

View Replies !    View Related
Stage Movement Based On Mouse Position
Hi, I'm looking for the stage (An MC) to move in the opposite direction of the mouse to allow the user to browse the entire image. I want it to ease in and out when it gets to close to the mouse or to the edge.

Basically I'm looking for http://www.bobscube.com/ type effect exactly.

I've played with code to move mc's based on the mouse position but I'm clueless on how to stop the image when it reaches a certain point and to have the easing work both when your close as well as when your far.

I've tried a number of different things which is why I'm not posting anything. Everything had a flaw.

Thanks in advance

View Replies !    View Related
Screen Division Based On Cursor Position
I need advice in developing a dynamic user-controlled display. I've divided the layout into three equal parts. I wish to change these proportions based on cursor position:

if the user moves into panel A (left), panel A increases its width to 75% of the total area while panels B and C contract to fill the remaining 25% (at right).

if the user moves into panel B (center), panel B increases its width to 75% of the total area while panels A (moving left) and C (moving right) contract to fill the remaining 25%.

if the user moves into panel C (right), panel C increases its width to 75% of the total area while panels A and B contract to fill the remaining 25% (at left).

Any ideas?

View Replies !    View Related
Scrolling Background Based On Mouse Position
Scrolling background Hi all, does anyone know where i can find a script to attach to a movie/background image so that i can make the movie clip pan left or right based on the mouse position (with easing too!)? Example http://www.saintsandsoldiers.com/ make sure you enter the site thats where you will see what i mean. I've been wanting to create a page like this for some time using png files and transperency and multiple layers.

Thanks all!

View Replies !    View Related
Movie Clip Position Based On Time Of Day...
Hey people,

Quick question, may be simple, may be complex, not sure, but I am trying to figure a way how to control a movie clip's action based on the computer's system time.

So say if it is before 12:00pm , I want the movie clip to gotoAndStop frame 1,

if it is after 12:00pm go to frame 2.

seems simple, but haven't messed with Flash's control of system time. I think it can be done,
cool beans,

Thanks guys.

View Replies !    View Related
Horizontal Scrolling Based On Mouse Position
Hey,

I'm sure this is a pretty common thing, but I've done some searching and didn't come up with what I needed... So I was wondering if anybody could point me in the direction of a tutorial that may help me create something like the scrolling portfolio at SectionSeven, ie, the way it's a long, horizontal list of images, and when you move your mouse either to the left or right sides, it scrolls accordingly. I also like how the farther to the side your mouse is, the faster it scrolls. It also seems to have "momentum", so for instance, if you're scrolling really fast to the left, and then you quickly move your mouse to the right side, it smoothly slows down, and then starts to change direction.

I'm only interested in the scrolling, I don't need the 3D page effect at all.

Thanks for any help, I appreciate it.

View Replies !    View Related
Play To A Frame Based On Mouse Position...
i need to create an effect similar to this >> visit www.c-class.co.uk then click on C The Car...

i'm workin on a car site..i'll be getting the 3d renders as frames...wat i want iss the car to turn in the direction of the mouse pointer...except that it wont be 360 like the c-class site...it'll need to turn jus about 45degrees.

please help...

View Replies !    View Related
Scrolling Based On Mouse Position Quest
I have a playlist on the stage in a movieClip which is masked by a mask so that only a small portion is visible.

I have added a scroll function to that movieClip so that is scrolls up and down (with restrains ofcourse) based on my mouseY position on the stage.

Now, I found this formula for scrooling once somewhere else and it works fine...

container.y += Math.cos((-root.mouseY/stage.stageHeight)*Math.PI)*15;

...or it can be written this way ofcourse to scroll from side to side:

fullContainer.x += Math.cos((-root.mouseX/stage.stageWidth)*Math.PI)*15;

...and that number (15) repersents the speed of a scroll.

I have used this formula couple of times on some galleries i have created and it works just fine, but the content which is being applied to scroolls regardless the mouse is above the content we want to scroll or anywhere on the stage, BUT I wanted to create what has been created here, on this site: http://www.flashden.net/files/55697/index.html

when the home page opens, go down below to the right, there is a button for opening a playlist, and when the playlist opens on the center of the stage, this playlist can also be scrolled up and down based on the mouse position, BUT it ONLY scrolls when the mouse IS ABOVE the playlist, and anywhere else it doesnt scroll and there is a message: "close playlist"
now, what I am interested in is how to make this scrollable only when mouse is above the content we want to scroll.

If someone can enlighten me I would be greatly satisfied


--------
fullContainer.addEventListener(Event.ENTER_FRAME, cosinus);
function cosinus(e:Event) {
fullContainer.y += Math.cos((-root.mouseY/stage.stageHeight)*Math.PI)*15;

if (fullContainer.y > 0) { // the restrains
fullContainer.y = 0;
}
if (fullContainer.y < - 300) { // the restrains
fullContainer.y = - 300;
}
}
----------


sorry for the long post and Happy New Year everyone!

View Replies !    View Related
Screen Division Based On Cursor Position
I need advice in developing a dynamic user-controlled display. I've divided the layout into three equal parts. I wish to change these proportions based on cursor position:

if the user moves into panel A (left), panel A increases its width to 75% of the total area while panels B and C contract to fill the remaining 25% (at right).

if the user moves into panel B (center), panel B increases its width to 75% of the total area while panels A (moving left) and C (moving right) contract to fill the remaining 25%.

if the user moves into panel C (right), panel C increases its width to 75% of the total area while panels A and B contract to fill the remaining 25% (at left).

Any ideas?

View Replies !    View Related
Mouse Position Based Horizontal Scroller
Hi,

I am fairly new to Flash. I have looked around the internet for clues but I can't find exactly what I need.

I have a timeline movie (movieclip) which is 1740pixels wide.

I want the timeline to scroll left and right as the mouse is moved left and right from the center of the parent movie (744px wide)

I want the scrolling to be faster at the edges than at the center.

I also want the scrolling to stop when it reaches the end of the timeline + 200px.

Any help would be appreciated - I have given the timeline an instance name of 'timeline'

View Replies !    View Related
Sliding Boxes Based On User's Mouse Position - How?
What I'm trying to do is an old Flash trick but I'll be danged if I can find a good tutorial online. I'm trying to create a simple interface where the bottom of the screen is lined with eight or so boxes.

When a user rests the mouse cursor to the right hand side fo the boxes, the boxes speedily slide to the left, slowing down the closer the cursor gets to the center. Cursor goes left, boxes slide right. Boxes loop, and stop if user mouses off.

I'm sure a tutorial describing the above exists somewhere on the site, but I'm really having trouble finding it.

Can anyone help? Thanks!

View Replies !    View Related
Scrolling Movie Clip Based On Cursor Position?
Hi,

I'm trying to work out how to create a movieclip containing buttons which 'scrolls' left if the cursor is moved right and visa-versa. An example of what I'm trying to achieve can be seen in the navigation bar on http://www.digitalscience.za.org/flashindex.htm

Could anyone point me in the direction of a tutorial that covers this? I just can't seem to find any help.

Thanks in advance,

Stephen.

View Replies !    View Related
Buttons That React Differently Based On Their Position To The Stage
Hi,

I'm a flash newbie and would post in the newbie forums (i've already got some other stuff going in there) but i'm pretty sure this is a complicated AS question!

I've made 4 different versions of a button. The button 'grows' a box with a small bit of info (like an ALT tag or tooltip). The 4 different versions grow in different directions (NE, SE, SW, NW).

They will be placed on a map to draw attention to it's landmarks. The map will be movable which means that the buttons will grow in the correct direction at first, but if the map is moved...

I'm hoping someone can show me a way to have the button load a different MovieClip for it's OVER state based on it's position.

TIA for any help!

PS. Currently i can only get the buttons to a) move with the map but not work, or b) work but not move with the map. I think i've got someone trying to help me sort that out though so don't worry about that unless you want to!

View Replies !    View Related
Move Movie Clip Based On Mouse Position.
I have a movie clip that is masked in a 400x400 square.

I basically just want to be able to mouse around within the 400x400 square and have the movie clip move within those boundaries, without breaking them, cause then you will see the edges of the image.

I' know this is pretty basic I'm assuming.. but I haven't had much experience with mouse/movie clip positioning.

I have the basic of basics start:


Code:
onClipEvent (enterFrame) {
this._x = _root._xmouse;
this._y = _root._ymouse;
}
I'm really just looking for some places to find info on how to do this.. even if its not it exactly, cause I won't learn much if I'm just given the answer.

Thanks.

View Replies !    View Related
...:: Play Movie Speed Based On Mouse Position ::...
I saw a cool site, http://www.peroniitaly.com/gb/flash.html - its the dogs balaclavas and I want to duplicate the action script for a site Im working on.

I have no idea where to start other than ask you fine people how to go about doing this, I checked through this site for any fla's but they are all scrolling based on mouse position...

BTW has this site won site of the day?

Cheers
Chris

View Replies !    View Related
How Can I Get The Stage-based _x And _y Position Of A Nested Movie Clip?
I have a movie clip that has another movie clip nested in it. The parent movie clip rotates, causing the nested movie to rotate also. (Think of a planet orbiting the sun.) My problem is that I want to continuously get the _x and _y coordinates of the nested movie clip/planet. But I want them in the stage's frame of reference, not the parent clip's reference, since those don't change in respect to the parent clip.

Obviously, the planet is moving all over the stage, but I don't know how to get its position in the stage's frame of reference.

Can anyone tell me how that's supposed to be done?

Thanks a lot!

View Replies !    View Related
Kirupa Vertical Scrolling Based On Mouse Position
Hi,

I've made a scrolling text that detects the mouse Y position for a movie that is published in 100% width and height. The scrolling is based on the tutorial http://www.kirupa.com/developer/flash8/scrollbar5.htm

But unlike this tutorial I don't have any scroll track or scroll face to control the scrolling. It entirely depends on the mouse position. The attached file is working but continue the scrolling after the point it should stop. I'm really frustrated and all ready spent lot of time for this. Any help will really appreciated


Attachment : http://www.mysharefile.com/v/9910920...irupa.fla.html

View Replies !    View Related
Movie Clip Adjusts Position Based On Browser Size
Hello,

I do not have much flash actionscript knowledge. I'm trying to take a movie clip and have it float on the left side of the screen about 20 pixels. I already have my page set up to 100% and my window mode transparent so that I can put things on the outside of my stage and it still shows up in the html page. I want an 'elastic' type page so no matter your browser window size the object floats and follows the users browser window size. I have researched stage.onresize, but it needs to follow the browser size, not the stage size. I'm not sure if I'm making sense or how to go about this. Here is a link to the webpage I'm working on, so you can take a look and better visualize what I'm trying to do.

http://bigpicturepro.com/Test/

If you take a look the red box to the right is what I want to 'float' It is right now not on the stage of my fla. Any suggestions would be greatly appreciated. Thanks. Ashley

View Replies !    View Related
Changing Background Based On Time? Please Help
I am trying to make an intro screen for a site and I would like to have a slightly different background depending on what time of day it is. Trying to get this idea to work, I have followed an old tutorial I found here on flashkit, and I used the following actionscript in my test:

onLoad; {
daynight = new Date();
dayframe = daynight.getHours()+1;
this.gotoAndStop(dayframe);
}

the test movie has 24 frames, and this way it WILL work and I can have different graphics for anyone of the different 24 frames, but it causes the movie to stop. the intro movie I had in mind has looping graphics motion, some links, and a sound loop. it obviously does not move when stopped on a frame :(

Is there anyway to make this kind of a script based on hours but have it load a different background (depending on time), and then put my moving images, sound, and links on top of that? what if i export it and then have it load the .swf file over the background? but even then there are a lot of areas i would want transparent, not just a big rectangle over a background color... I don't know if you can make it transparent and then import it that way, can you?

Here is my existing intro (http://www.aveneaux.com/avene2.html the links do not work yet, still just testing it). Is it possible to do what i want to do with the changing background based on time, and if so, how?? any help or ideas would be greatly appreciated!

View Replies !    View Related
HELP - Changing Password Based On The Date
I need to figure out how to implement a changing password based on the date in Flash MX. I need to allow the user to use their password for three or four days and then have it expire based on the date. The password has to be alphanumeric. Example:

P17053MGP

The five digit number after the P is actually the date. In the example above the order is day (two digits), then month (two digits) then year (one digit), so in this example the date is 17, May, 2003. This password will work for today plus three days. That is until midnight on May 20 in this example. If it does not exactly match the format above with the date number still valid, then it should give an error message:

Please contact administrator for a valid password. – It does not matter what this says, it just has to say something to that effect.

Alright, this is where it gets even trickier. The alpha part of the password is actually supposed to direct the user to one of four pages or frames based on the letters entered. Example:

PxxxxxMGN – 01.htm or frame 1
PxxxxxMGP – 02.htm or frame 2
PxxxxxMYF – 03.htm or frame 3
PxxxxxMKT – 04.htm or frame 4

This is for an extra credit assignment for an advanced Flash MX class and I could really use some help with it. I missed an assignment and need the extra credit points to pass with a decent grade.

Any help at all is greatly appreciated.

Thank you for your time.

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