Trailing X Y Constraints?
Is there a way to constrain X/Y Mouse Trailers to a certain Area???
So I can just have them over buttons etc instead of move around the entire movie?
FlashKit > Flash Help > Flash General Help
Posted on: 05-26-2003, 08:11 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Browser Constraints
I've been sitting around for nearly 2 days, trying to figure out how to constrain the size of the browser to no avail.
I was wondering if anyone can tell me how to?
I'm thinking it needs some code.
It's a bit hard for me to explain, but i'm talking about the broswer not being able to be streched, no nav bars or scroll bar, Just the TITLE bar and the close button are present.
if you still dont understand try
http://wme.cjb.net
skip the intro
the follow the big link
and a window should pop up that cant be modified
that is what im talking about....
cheers if anyone can help.......
plz im desperate
StartDrag Constraints
Hi - I'm trying to get a good, zoomable, draggable map compatible with Flash 4. I'm pretty close, but I want to constrain the drag to when the mouse cursor is within the viewable map area, and to stop dragging when the cursor is moved outside that area.
Part of the reason I want to do this is that it seems more useable (it's weird to be dragging something from a point that is hidden behind an object). The other reason is that, if a user drags outside the viewing area trying to get to the left side of the map, and releases the mouse over any of the buttons in my slider movie (there are lots of them) the stopDrag action isn't read and the map gets "stuck" to the cursor. I assume this is due to the on(dragOver) actions on many of these buttons, although I can't logically see why.
In the attached file, the drag is constrained using a startDrag action and the coordinates, but when the map is fully zoomed, this prevents the outer regions from being viewed.
Anyway, if you unzip these to a folder and export chesterfield.fla you'll see what I'm talking about. Thanks for taking a look at this!
M
Dragging With Constraints
Greetings to the reader,
For some kind of interactive art project I need to recreate some
kind of cheesy gun-interface with Actionscript, and for the trigger
I had the following in mind:
I want to be able to drag the trigger backwards (which will cause
it to rotate slightly around a pivot point, but not actually move),
but it must seem like there's a bit of friction (i.e.: it's not a
matter of dragging the mouse back and that's it, it must seem
like you need a bit more force to pull 'the metal of the trigger'
back) and when you reach a certain point the dragging won't go any
further and when you release the mouse button the trigger will
snap back.
Nice idea and all, but I've no idea how to do this, 'cause when I
want it to rotate, it won't stick to a pivot point and I'm having
a bit of trouble with dragging.
Anyone can be of assistance ? I'd appreciate it.
Rotation Constraints?
Ok, so heres what im trying to do: (i drew a sweet diagram :])
http://img233.imageshack.us/img233/82/rotationod6.jpg
the little blue crosshair rotates and points towards the mouse, but i want it not to rotate past the two red angles.
here is the code, but for some reason, its not working, and i dont know why
Code:
onClipEvent (enterFrame) {
radians = Math.atan2(_root._ymouse-this._y, _root._xmouse-this._x);
degrees = (radians/Math.PI)*180;
this._rotation = degrees;
if (this._rotation<=-160) {
this._rotation = -160;
}
if (this._rotation<=160) {
this._rotation = 160;
}
}
StartDrag And Constraints
Last edited by utoks : 2004-12-16 at 12:42.
So heres my little flash:
http://j.bluecloudstudio.com/map.html
Basically what it does right now is zoom in on a graphic and then go left and right by using startdrag and stopdrag.
But what i want it to do is when you zoom in some and then drag it to the left it should stop when the blue border is touching the end of the graphic. This way it will never pan all the way to the left where you see blank white space.
here is my fla's
http://j.bluecloudstudio.com/MAP.FLA
and the sliderbar.fla
http://j.bluecloudstudio.com/sliderbar.fla
i think that flash5's startdrag has constraint paramaters but i dont know how to make these stop the drag when the edge of the map graphic is touching the edge of hte blue border
(this was edited because it didnt make much sense-- sorry about that)
any help would be greatly appreciated.
my email is fjood@inmail.sk. Thanks!
Dragable Window Constraints
Ok, I've got this movie clip that I want to be able to drag in a designated rectangle. The code behind the movie clip is:
on (press) {
startDrag ("");
}
on (release) {
stopDrag ();
}
How can I modify this code to make it so the user cant drag the movie clip all over the place? Fictitous numbers are fine for the constraints. Thanks a lot!
Ragdoll-ish Physics With Constraints..?
Hi,
I'm currently working on a little game -- that's turning out to be not such a "little" project after all! My idea is a sort of side-scroller that will use the mouse almost exclusively -- to dodge, walk, jump, and, while holding a certain key, punching, kicking, and perhaps even weapons (much much later!). The idea was a sort of simulation of chinese drunken boxing (which I know nothing about, sadly), also commonly known as "drunk fu." Granted, it will be nothing like it, but it's a good title/label, and it inspired the control scheme anyway.
My main problem, as you might expect, is dynamically moving the player's body according to the mouse position. What this has necessitated, of course, is (as in the title) ragdoll-ish physics. What I've tried to do so far is something along the lines of inverse kinematics and it works, for the most part. My attempts at limitting the angle (to prevent knees from bending backwards, etc.) didn't work, and I think are still commented out. Also, I'm not sure how to ancor the body's movements to the feet (the constraints).
Here's a brief explanation of how the controls work, so far:
There is a somewhat elliptical shape around the player. Moving the mouse within this area (the boundaries of which are represented by colored dots in the file) allows the player to dodge. In the code, I refer to moving the "balance point" or center of gravity, which is the mouse's position. This could probably be done better, but it seems to work for now.
When the mouse is moved outside of the area, the player moves in that direction, jumping if appropriate. (I have a very basic implementation of gravity which seems to work okay. Fine tuning is need, though... but that's a low priority atm )
I'm using my brother's old version of Flash 5, since I'm too lazy/poor to upgrade. *sigh* I'm sure MX would make this easier, but alas....
Anyhow, any help would be GREATLY appreciated! I doubt it would help, but I can upload the swf to my server.
NOTE: I know that the arms and neck/head don't move. I figure once I figure out how to move the legs properly, doing the arms will be easy
NOTE2: I know rotating/moving everything manually is EXTREMELY inefficient. However, since I couldn't come up with a decent algorithm for doing it the hard way, I didn't figure that making a function to run the (non-existant) algorithm for everything would help me much. I plan to make this function, though, whenever I get things figured out. As you can hopefully see in the fla file, i set up arrays in preparation for an IK chain function (frame 2 i think)
Noobie Question Re Constraints
Hi all, I hope someone can help me. I have taken on some small freelance work and have been asked by a company to develope a flash banner ad (468x60). All is well and the banner works fine and links through and I thought the job was finished. But no, the company in question wants me to make sure the flash .swf file is 'constrained' to the correct size so that thier affiliates who will be using the banner do not need to add the sizing in the html code.
This is puzzling me a little since I have always used the width and height parameters when embedding in a web page. The great thing about flash is that you can change these parameters to whatever you want without losing quailty.
Does anybody understand what these guys are after and how to go about it? My publish settings are flash 6, 468x60, actionscript 1.0.
Thanks
R
Making Constraints On A Symbol...
I'm new here and I'm taking a class on Director. Unfortunately, my teacher does not know how to do much himself which is leaving me to come here and seek advice. Flash is a better option for what I'm looking for and Director is moved out anyway. Please forgive me in advance for any stupid questions and the like since I have not learned much.
I am creating a video game similar to Arakanoid but with a small amount of moving objects instead of stationary objects. I am not trying to make an exact recreation but at least something that is playable and fun that can be made in Di.
I am just taking it one step at a time so my question is, am I able to create a border around this portion of my picture? The black border is also part of the same PNG. Is it possible to create a border in the code so nothing passes that section or does my picture have to be separate from the black border? Basically, I want all actions constrained within that picture frame.
I hope this question makes enough sense. Thank you for any help. ^_^
Edited: 12/02/2008 at 07:44:13 PM by sirkibble2
Loaded Clip Constraints
I have some code that loads a movie to a certain area on my stage. Unfortunately though, the movie is un contained.
By that, I mean that things that are supposed to be off stage (invisible) are visible. Is there a way to foce the loaded clip to only show what is on the stage of the loaded clip?
As it stands right now, the clip i have is 250px by 20px
i have text swinging in from the right and exiting left. instead of seeing the textonly on the stage area of the MC i can see it to the right of the mc stage area (over my parent stage) and when it leaves, it just continues to move off the mc stage and over my parent stage.
PLEASE! anyone HELP, (i have no more fingernails because of this!!!) Thanks
LoadMovie Width Constraints
Hello people,
I'm new to the forum and want to extend greetings.
I have a problem, and I know I am overlooking the obvious so I am prepared to slap myself afterwards.
I am loading swf A into a mc within swf B.
loadMovie(dir/A.swf,target_mc);
How do I constrain the width of A so it is its' normal size?
It wants to span the width of swf B.
I tried adding "_width=470" but my syntax is not right and/or working.
I am using Pro 8
Any help will be greatly appreciated!
Thanks ahead of time,
S1phrX
"Just another FLASHing boob!"
AS3: Layout (Constraints) Class
I've been meaning to do one of these for a while but never got the incentive until someone else started talking about it So I made a class that manages layouts for movie clips and other display objects. It lets you set position, size, center or top, right, bottom, or left constraints (similar to Flex). The following example shows basic usage and what behavior it can provide (source files available in link).
http://www.senocular.com/demo/Layout/LayoutWindows.html
There are a fairly good number of properties for a layout, and it's use may not be 100% obvious, so I will probably need to provide some extra documentation, but the example should be a good place to get started. It uses most of the features and lets you see what the class is capable of.
Also, there is no GUI like in Flex, its all just AS
Note: For the most up to date version of the classes, always use
http://www.senocular.com/flash/actionscript
Loaded Clip Constraints
I have some code that loads a movie to a certain area on my stage. Unfortunately though, the movie is un contained.
By that, I mean that things that are supposed to be off stage (invisible) are visible. Is there a way to foce the loaded clip to only show what is on the stage of the loaded clip?
As it stands right now, the clip i have is 250px by 20px
i have text swinging in from the right and exiting left. instead of seeing the textonly on the stage area of the MC i can see it to the right of the mc stage area (over my parent stage) and when it leaves, it just continues to move off the mc stage and over my parent stage.
PLEASE! anyone HELP, (i have no more fingernails because of this!!!) Thanks
Constraints On A Mouse Follower
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 curtain distance and then the movie clip should pop back to its original x and y position.
I managed to come up with this but from here on I'm a bit stuck
Code:
private function init():void
{
addChild(backgrnd);
backgrnd.x = 0;
backgrnd.y = 0;
addChild(levelTwo);
addChild(levelOne);
levelOne.x = stage.stageWidth / 2;
levelOne.y = stage.stageHeight / 2;
levelTwo.x = stage.stageWidth / 2;
levelTwo.y = stage.stageHeight / 2;
stage.addEventListener(Event.ENTER_FRAME, mouseFollow);
}
public function mouseFollow(event:Event):void
{
distX = levelOne.x - mouseX;
distY = levelOne.y - mouseY;
distX2 = levelTwo.x - mouseX;
distY2 = levelTwo.y - mouseY;
levelOne.x -= distX / 10;
levelOne.y -= distY / 10;
levelTwo.x -= distX2 / 70;
levelTwo.y -= distY2 / 70;
stage.addEventListener(Event.ENTER_FRAME, howFar);
}
public function howFar(event:Event):void
{
var whereX:Number = (levelOne.x - mouseX);
var whereY:Number = (levelOne.y - mouseY);
if (whereX <= 30)
{
if (whereY <= 10)
{
levelOne.x = stage.stageWidth / 2;
levelOne.y = stage.stageHeight / 2;
}
}
}
Movie Clip Width Constraints
hey all - i'm making a flash movie with a hella long image (which i'm building as a movie clip). i'm planning on using scrollbars built into the file to scroll it, so i don't want to make the movie any wider. however, its longer than the allowable build space in flashMX... suggestions???? the image can't reallly be broken up into links, its very important that it scroll...
thanks
Scroller - Are There Size (dimensions) Constraints?
I have a horizontal scoller that moves based on the _x of a draggable button. Here is the code
Code:
on (release) {
//d is just a variable for snapping the button
d = 20;
x = 182;
xdistance = getProperty("../thing", _x)-x;
//trace("Xdistance = " add xdistance add newline add "Ydistance = " add ydistance);
if ((Number(Xdistance)>Number((-1*d)) and Number(Xdistance)<Number(d))) {
stopDrag();
setProperty("../thing", _x, x);
_root.move = true;
_root.xmov = 125;
_root.mainScroller.blur._alpha = 100;
_root.mainScroller.blur.onEnterFrame = function() {
_root.mainScroller.blur._alpha -= 2;}
_root.body.garry01.gotoAndPlay(2);
//displays day of tour in text field
_root.tourDate.text=("Tuesday, May 12, 2005");
} else {
stopDrag();
}
}
Basically 'd' has to do with a snap command so you can ignore that, the rest of the code moves the mainScroller based on where 'thing' is.
My question is this. I have 10 images that are 720px wide. If I have a horizontal scroller and I try to include 10 images which are side by side I get a error in Flash saying something like invalid size. Are there constraits in Flash? my Mc might be something like 4567px long when done, is this a problem?
Thismc.startDrag(...constraints..) Confusion
Hello,
(ADDED/EDITED AFER POSTING: Actually, my greatest issue is not the formula, after describing it to you I can think more clearly now ;-) - but my lack of understanding of what those constraints in startDrag(...) actually mean/do. When I have all values (withs and constraints) I should know what to expect on screen - but I'm very often completely surprised by the result.)
I am thoroughly confused now. I have a movieclip with an onMouseDown event attached to it that calls startDrag(..). So far so easy - but I don't want the user to drag it too far outside the screen. The mc holds a print preview. The catch: I also have zoom-in/out buttons and they change mc._xscale and mc._yscale.
So I cannot use fixed values for the constraints, I have to calculate them - but how? I have been unable to find a rule (formula) that works under all conditions - mc size (x,y separately) larger or smaller than the screen?
Example for the complexity:
- If it's smaller I want the user to be able to drag it left to the left until the mc's left edge touches the left screen boundary.
- However, if it's larger I want the user to be able to drag it so far outside left until the RIGHT edge plus 100px space is visible. (It is a preview for print, after all)
- x and y have to be looked at separately
My problem: Unlike 20 years ago (in school, I'm not THAT old), when I wrote complex algorithms using my brain, pen and paper I have now adopted the coding method of today (I've seen it in action many times at some large and well-known software firms... where the code is so ugly and complex that it's almost the only way left to get any work done), which seems to be to start coding randomly, check the result, change something, run again, etc. :-(
Ahhh, describing the problem already helped... let's see if I can figure it out after lunch. But if anyone already has the algorithm for this not-so-unsual issue - after all, something exactly like this is needed for any zoom-and-drag function to view something that could be larger than the stage (like image viewers) - I'd welcome the help :-)
Thanks,
Michael
PS: my stage size is 800x600 and when the mc is larger than the stage I want 100px space and not stop dragging exactly at the edge - but I want no space when it's smaller than the stage.
Attach Code
// current snapshot of the experiments - I've been changing the formula around
// many many times without being able to think it through :-(
// the code for the zoom in/out is somewhere else (simple: adds +-10 to _x|_yscale)
pg1.onMouseDown = function() {
if (pg1._width < 800) {
xC = (800-pg1._width);
} else {
xC = 700;
}
if (pg1._height < 500) {
yC = (500-pg1._height);
} else {
yC = 500;
}
pg1.startDrag(false, xC, -pg1._height+yC, 100,100);
}
pg1.onMouseUp = function() {
pg1.stopDrag();
}
Edited: 09/04/2007 at 03:41:44 AM by Hasenstein
Movie / Image Size Constraints.
I am trying to build a system for map navigation, that will let the user both scroll and zoom on another image or movie clip. Seems easy enough, but am quickly running into a problem of the content getting too big. I haven't narrowed down the exact limit yet, but somewhere between 6000 and 10000 pixels, flash begins to introduce rendering errors when I scroll the image to the right past a certain point. Is there a documented limit somewhere on how big a movie clip or image can be resized? I know that movie clips can't be defined greater than 2500 pixels. Is it some multiple of that number? I know I can import images larger than that, but that still doesn't help me figure out where this limit (be it a bug, or feature) lies. Once you start zooming in on a clip of that size, it blows up pretty quickly.
So far I've been playing with the stock scrollPane component, and the Loader component. An alternate approach might be to build a component that loads the map at its native resolution, and then uses a scaled mask to establish a viewport on that map, which I would then resize to show the view.
My two issues then become:
1) How do I dynamically specify stage dimensions for a movie clip in order to create this viewport? Can you somehow use a clip mask to establish component dimensions?
2) Will I still run into scaling problems? Will flash scale the whole movieclip to fit in the parent clip that holds it, and then mask things off... or will it mask and then scale? It is my hope that the later could circumvent the rendering issues I'm running into.
I'm fairly new to flash, so I may be missing some fundamental concepts here. I'll also probably need to do some more research on building custom components, but I was hoping someone could give me some sage advice, or at least lead me in the right direction.
Thanks,
-paul
Trailing (following)
I use Flash MX, (AS2) and i've been trying for quite some time to make an object follow another object whenever it moves for whatever reason(tweens, dragging, via pressing keys, etc. Sort of like the player in this game:
http://www.media.ebaumsworld.com/fireballs.swf
Can anyone tell me how to do this with actionscript?
Trailing Mc
hi there.
a simple(ish) question.
how do i make multiples of an mc trail another mc, abit like smoke out of an exaughst, or a a trail in the snow after a snow board has gone passed.
thanks for your time.
zlatan...
Trailing
i'm a newbie and this may be the dumbest question ever made here but I have no other source to ask: I wonder how to make a movie clip of a pen writing in a piece of paper.
is there a good samaritan to help me?
tks a lot
Why Is These MC's Trailing?
I have set up a image loader with resizeble borders from a script i got.... oh can't remember where...
well my trouble is that normal resize scripts are expanding a border mc and thats allright if have hairline border around your images. In my setup I'm trying to have two bars of dropshadows in top and bottom and i don't want them to strech out of shape so i tried attaching them to the holder as two mc...
but they are trailing behind like THIS
I have this code on the main MC that contains the square_mc, border_mc and the two top and bottom mc's
ActionScript Code:
onClipEvent (load) {
//spacing = 300;
//this.createEmptyMovieClip("holder", 1);
/*Just call this function, only give the url of the image or swf*/
function loadPic(p) {
var o = new Object();
o.onLoadInit = function(mc) {
mc._visible = false;
DoResize(mc._width, mc._height);
};
var ml = new MovieClipLoader();
ml.addListener(o);
ml.loadClip(p, this.holder);
}
function DoResize(w, h) {
var duration = 20;
var t = 0;
/*calculate the amount of pixel to scale*/
var startw = this.square._width;
var endw = w-startw;
var starth = this.square._height;
var endh = h-starth ;
this.onEnterFrame = function() {
if (t<duration) {
this.square._width = easeInOut(t, startw, endw, duration);
this.square._height = easeInOut(t, starth, endh, duration);
t++;
} else {
delete this.onEnterFrame;
/*replace the holder in the correct position*/
this.holder._x = -(w/2);
this.holder._y = -(h/2);
/*show it*/
this.holder._visible = true;
/*Just a simple fade to make it sweet*/
Fade();
}
};
}
function Fade() {
var duration = 20;
var step = 100/duration;
this.holder._alpha = 0;
this.onEnterFrame = function() {
this.holder._alpha += step;
if (this.holder._alpha>=100) {
delete this.onEnterFrame;
}
};
}
function easeInOut(t:Number, b:Number, c:Number, d:Number):Number {
/*By Robert Penner*/
/*see [url]www.robertpenner.com[/url] for details*/
if ((t /= d/2)<1) {
return c/2*t*t+b;
}
return -c/2*((--t)*(t-2)-1)+b;
}
}
and this on the top_mc
ActionScript Code:
onClipEvent (enterFrame) {
this._y = - _parent.square._height/2;
updateAfterEvent();
}
and this on the bottom
ActionScript Code:
onClipEvent (enterFrame) {
this._y = _parent.square._y+_parent.square._height/2;
}
what can it be?
could it be the penner script in the bottom?
I'l have to try out with a laco tween instead... but stil any suggestions are more than welcome
Change Rectangular Constraints Dynamically When Dragging?
Hi,
I have a draggable movie clip. It is something being dragged out of a test tube and over to a piece of paper. While it is still being dragged "within" the test tube, I would like for the rectangular constraints to be very narrow so it looks like you can't drag it through the side of the test tube but you have to drag it to the opening at the top of the tube.
Once you drag it beyond the top of the tube, I would like for the user to be able to drag the object around more freely, i.e. I need a bigger constraint rectangle.
Has anybody tried this before?
If I use a variable for each of the four constraints, will it recognize a change in the variables and change the rectangle accordingly, or does it only go by the values the constraints are set to initially, when first calling "startDrag"?
[CS3] Creating New Pop Up Window With Height And Width Constraints.
Hi,
I would really like to know how to create a pop up window where the height and width are set which all sounds easy enough and i actually could manage that BUT i am trying to input it into an already made script.
It is a XSPF music player located here and if you have a look at the examples on the page, i would like the button that says link (shows up under the picture when you click on a track) to be directed to a new window that is set to a specific height and width and pref with no toolbars or anything.
I think i have located the correct bit of code to edit but am not sure how to inplement it. The code is this:
//info button
if(playlist_array[track_index].info!=undefined){
info_mc._visible = true;
info_mc.info_btn.onPress = function(){
getURL(playlist_array[track_index].info,"_blank")
}
}else{
info_mc._visible = false;
}
I have tried a few things but i'm not competent enough with flash to know how to edit it properly and know what to change etc.
Hope someone can help
Flash 8 Snapping And Constraints Poorly Implemented
Am I the only person who is consistently frustrated by Flash's bizarre implementation of snapping and constraints?
Try the following:
Open a new Flash 8 document, type the word "ALIGN" in a new textbox. Choose any font you like.
Now, we're going to create a copy of this word, and we want it to line up vertically with the other one (a very common task).
First, disable all snapping entirely, just to avoid any additional weirdness.
So, grab your Move tool (black arrow tool) and then hold down the Alt key (to leave a copy behind).
Start to drag the text horizontally. Hold down the SHIFT key to contrain that motion.
Observe carefully what has occurred. The second textbox is either slightly higher or slightly lower than the first textbox. And yet the SHIFT key was held down! This completely goes against the way the SHIFT key as constraint modifier key works in every other major application out there. It just makes no sense at all. The SHIFT key in Flash constrains the motion to horzontal, vertical or 45 degrees, BUT there's some kind of rounding error that causes the object to jump first.
Let's try something else.
We're going to try to line up the text to a guide. Enable rulers (View > Rulers). Now drag a guide from your vertical ruler and drop it on the page. Okay, we need to turn Snap to Guides on. View > Snapping > Snap to Guides.
Grab any of the two textboxes. We're going to align its right-hand edge to the guide. So, using the Move tool once again, grab the text object by its right-hand edge. Wait! Flash's crappy textbox implementation doesn't allow us to grab the box by one of its corner anchors (because that would resize the textbox of course); make sure you grab the textbox by its edge but NOT by a corner anchor.
If you're lucky, you may see the circular "snapping" cursor appear on or near the edge that you clicked. If you see this cursor - congratulations, the textbox will snap to the guide (though the "constraint" issue mentioned above with the SHIFT key still crops up). If that worked for you, change the zoom. Zoom into the scene (CTRL + Plus). Now try again. Did it work? Chances are, the snapping stopped working after you exceeded 100% zoom. What's up with that?
If ANYONE has managed to get work around Flash's horrible implementation of snapping and SHIFT-key constraints, I'd love to hear it. Please post it here and I for one with thank you profusely. It seems that absolutely no-one has written about this issue.
Trailing Effect
Hey,
How do u do the trailing effect of a object.......there is an example of what i am talking about near the end of the movie when the two guys slow down into slow motion........please check it out.
L8
http://www.flashkit.com/movies/Anima...88/index.shtml
Trailing Effect
Hey,
How do u do the trailing effect of a object.......there is an example of what i am talking about near the end of the movie when the two guys slow down into slow motion........please check it out.
L8
http://www.flashkit.com/movies/Anima...88/index.shtml
Trailing Snake
Somebody please help ...I am a beginner Flash 5.0 user. I am trying to create a line that starts from one side of my movie, and moves along a pre-determined path (preferable along a straight line, forming an open circle in the middle of the movie, and then ending with a straight line across to the other side of the movie). i want to start with a blank movie and end with this finished graphic. ( i plan to fade words into the circle after it is done). how do i do this? i want to create a snake like effect with the line, where the snake gets longer as the line goes along its path
respond katz3@tcnj.edu
Trailing Snake
Somebody please help ...I am a beginner Flash 5.0 user. I am trying to create a line that starts from one side of my movie, and moves along a pre-determined path (preferable along a straight line, forming an open circle in the middle of the movie, and then ending with a straight line across to the other side of the movie). i want to start with a blank movie and end with this finished graphic. ( i plan to fade words into the circle after it is done). how do i do this? i want to create a snake like effect with the line, where the snake gets longer as the line goes along its path
respond katz3@tcnj.edu
Trailing Clip
Ok so if I want a clip to follow my mouse I can use something like this
onClipEvent (enterFrame) {
this._x = _root._xmouse
}
Now I want to confine that _x movement to limited range of the screen. Secondly I want to have the clip trail my mouse and slowly catch up as the mouse position settles.
A similar example would be the menu at http://www.hellodesign.com. However I'm not interested in the masking aspects of their menu. Any suggestions?
Line Trailing
Can someone help me find out how to code a object line follower? What I mean is that a never ending line follows an object as it goes throughout the movie. Basically, I have designed a script that moves an object to a certain location at a delayed rate. I would like a line to follow this object to the specified point, but it has to extend as it goes. I've been trying to piece together a code, but so far I cant seem to get it to work. Any help would be appreciated.
-edit- another question
I was wondering if there was a way to delay flash commands. I have made it so my script can read different locations and make my object go to those positions. However, I was wondering if it was possible for the object to go to each following position after the previous one was done.
Example:
1x = 500
1y = 500
2x = 400
2y = 400
User pushes a button which makes the object delayed move towards first point. Is it possible that after moving towards the first point, it makes to the next point? Also, I want the extending line to follow these two points. Help with this would be greal appreciated as I know this may be a tough code to write.
Preloader Trailing Behind
Hi All
I have a preloader which I know worked well at the beginning of the flash site but now as i have progressed it seems to have lost the plot.
Basically when simulating download the preloader is not visible nor indicate its % until it is approx 85% loaded. I have tried this online and again I have the same problem.
Any ideas or solutions....maybe this has happened to you.???????
Currency, Im Getting My Trailing 0's Cut Off
I have a dynamic text field that gets a value :
value = 2.80
myfield.text = "$" + value;
When it displays it shows up as $2.8.
Is there an easy way to fix this? I saw code to convert to currency but its a lot of code for one little field that will only have this problem 20% of the time... anything easier?
thanks
mcm
Pen Tool Trailing Off?
This happened to me sometime back, and I don't remember how it was fixed. Well it started happening again.
When I try drawing a curved path, the points that i previously laid down start trailing off... I'm not sure how to explain it, they just start moving away. Messes up my path, and doesn't even complete the line. It just keeps drawing segments.
anyone have this problem?
Movie Clip _x Control By Button Is Working But Needs _x Constraints
I have a movieclip thats position is controlled by a mcBack and mcNext buttons. Everytime the button is clicked the button moves 100 right and if the other button is clicked the movie clip moves the other direction 100. This all works fine but I need the movie clip to stop when it it reaches -1928 in one direction and 0 in the other direction. Can anyone help me? Here is the code that makes the timeline move on the stage.
PHP Code:
mcBack.onPress = function(){
mc_timeline._x += 100;
}
mcNext.onPress = function(){
mc_timeline._x -= 100;
}
Custom Trailing Cursor With Lag.
Hi there,
Can anyone offer any help? I want to create a cursor that has a trail that follows up when you move your mouse. But the thing is I want the trail to have a slight delay as well. If your a bit confused, visit http://www.squaresoft.com the trailing cursor on the first page of their site is exactly what i want to learn how to do. Any help at all is much appreciated
Mouse Trailing Objects
I'm trying to create an effect in the background where a trail is left behind where your mouse moves. basically like a simple drawing type of script, but it's "drawing" the whole time, regardless of whether your mouse is clicked or not.
i have no problem making this happen, but i want to make the segments of what is drawn disappear after 5 or 6 seconds. The only way i could think of doing this is creating a new movie clip where the mouse was before it moved, then drawing a line to where it is, then starting over by making a new one where the last MC left off. i'm having some problems figuring this out, does anyone have any suggestions?
Help Me Stop The Trailing Mouse
Hello,
I have a cool flame effect that I found in flashkit. The only problem is that it trails the mouse and I want to be able to place it in a stationary position.
here is the script.
code: _quality = "low";
// __ try adjusting these values for different effects.. __\
// __ NOTE: some changed values may not have effect,
// ... other values may need to be adjusted for effect to be seen__\
/:Smoke_amount = 12;
/:Fire_amount = 8;
// ____ Y off-set ________\
/:Smoke_Y_offset = -12;
/:Fire_Y_offset = 3;
// __ X fluctuation amplitude _____\
/:Smoke_X_amp = 12;
/:Fire_X_amp = 5;
// __ Speed of rise .......
// __ 0 = Stationary
// __ Negative value = descend
/:Smoke_riseSpd = .18;
/:Fire_riseSpd = 5;
// __ rate of dissipation _______\
/:Smoke_fade_rate = 1;
/:Fire_fade_rate = 18;
// __ point in which fire restarts at Ymouse coord__\
/:Fire_resart = 32;
// __ Rate of growth ..
// __ (0 = No Growth) (Negative Value = Shrink)
/:Smoke_grth_rate = 3;
/:Fire_grth_Xrate = -4;
/:Fire_grth_Yrate = -4;
// __ rotation rates & amplitudes _______\
/:Smoke_rotationRate = 2.3;
/:Fire_rotationAmp = 4;
// __ Max fire angle when mouse moves X __\
/:FireAngle_max = 60;
// ____ Min & Max sizes ___\
/:Smoke_size_min = 26;
/:Smoke_size_max = 112;
/:Fire_size_min = 5;
/:Fire_size_max = 100;
stop();
the clip includes a fire clip and smoke clip but I dont think they have anything to do with it following the mouse.
And suggestions would be greatly appreciated.
SR
Trailing String Effect
Hi Guys,
Can anyone point me in the direction of a tutorial that will help me achieve the following:
Ball on a string. When you drag the ball around the stage the string follows and is animating in a realistic way i.e. with physics.
Thanks
Trailing Mouse Cursor
Really need some help from some experienced users of flash.
I'm trying to create a glowing trail which fades outs after time as the mouse moves.
So far i've created the glowing trail but only when the mouse is down.
i would much rather have it without the mouse press.
can anyone give me some pointers or advice on how to solve the problem.
Cheers!!
( i've attached the fla file so you can see wht im trying to achieve)
Text Trailing Mouse Effect
Does anyone know the scripting involved to achieve the effect seen in the preloader to:
http://www.dreamshocker.com
The text follows the mouse so fluidly. Thanks for any help!
Trailing Scaling Interface Problems
?(5ou can see at
http://208.4.48.171/navtest/
Im trying to create an interactive interface with mouse traling, scaling, and rotation effects. Im in over my head especially with the rotation wich I could omit that if need be.
I modified some source code from www.bit-101.com and played
with it a bit. Its doing kind of what i want but has some problems.
I dont understand why the lines scale towards the mouse
sometimes and at other times away from it. Maybe because the mc centers are positioned at thier corners?
anyway heres the script
onClipEvent (load) {
_xscale = 0;
_yscale = 0;
speed = 5;
}
onClipEvent (enterFrame) {
targetx = _root._xmouse;
targety = _root._ymouse;
}
onClipEvent (enterFrame) {
_xscale += (targetx-_xscale)/speed;
_yscale += (targety-_yscale)/speed;
http://208.4.48.171/navtest/
[F8] Movieclip Trailing Mouse Issue
Hello,
I have a movie with a movieclip that trails behind the mouse pointer. The code I'm using is:
Code:
box.onEnterFrame = function(){
var xMouse = _root._xmouse;
var yMouse = _root._ymouse;
if(Math.abs(xMouse - this._x) == 0) {
this._x = xMouse;
this._y = yMouse;
} else {
this._x -= (this._x-xMouse) / 8;
this._y -= (this._y-yMouse) / 8;
}
}
Everything works fine, and it trails smoothly most of the time. Unfortunately, occassionally the movieclip suddenly jumps to where the mouse pointer is, rather than sliding over to it. It doesn't seem to have any rhyme or reason, and is sometimes difficult to replicate. It seems to happen more often when I suddenly move the mouse pointer quickly across the screen.
Does anyone see anything in my code that could be causing this issue? I've attached an .fla as well, so that you can see for yourself.
Thanks for any insight.
Specific Trailing Line Effect
I'm relatively new to flash so I'll try to describe the effect and prey for a response on it.
I'm wanting an effect where a curved line is drawn and a trail which has a glowing effect is left. I don't want the comet effect where the tail always stays perpendicular but rather where the line fades and follows the guide.
think of a snake where the line stays the same length and tails off but follows the same path.
Tracing The Outline With Trailing Effect.
Look at http://www.voxunity.com/adcons/en/. There is this white thing that goes along the dotted lines, lady etc with a smooth trailing effect. Does anyone know how to do this?
I can't seem to find a tutorial on it. Someone please help.
Circle Trailing/fading Effect
You know in Firefox when a page is loading, it will display a circular loading animation in the top right corner? See how it has this kind of fading effect -- I've seen this kind of thing done in Flash before, but cannot work out exactly how. I'd probably be able to do it with tweening/animation, but I'm sure there's a better way of doing it using ActionScript.
Here are a couple of movies I've seen that are kind of similar:
http://www.actionscript.org/showMovie.php?id=1119 -- this is kind of the effect I'm after, only not 3D like this
http://pureloaders.com/products/tren...1_preview.html -- the animation that is occuring behind the preloader with the fading circular effect is what I'm trying to do.
If anyone has seen a tutorial on the web that explains how to do this kinda thing, I'd appreciate the link! Thanks!
Making The Mouse A Trailing Rainbow
We all now what the swirling line thing can do. A mouse effect which creates a filled layer trail.
Code:
var points:Array = new Array();
var prev_xmouse:Number;
var prev_ymouse:Number;
this.onEnterFrame = function():Void {
this.clear();
this.lineStyle(1, 0xff0000, 0x00ff00, 0x0000ff); //
var colors:Array = [0xff0000, 0x00ff00, 0x0000ff];
//this.linestyle(gradient fill as if its a rainbox of colors)
//i want different colors coming out
var dx:Number = this._xmouse - prev_xmouse;
var vx:Number = dx ? dx : Math.random() * randSet(-1, 1);
var dy:Number = this._ymouse - prev_ymouse;
var vy:Number = dy ? dy : Math.random() * randSet(-1, 1);
var pLen:Number = points.push({x:this._xmouse, y:this._ymouse, vx:vx / 10, vy:vy / 10, life:getTimer()});
for (var i:Number = 0; i < pLen; i++) {
if (getTimer() - points[i].life > 1000) {
points.splice(i--, 1)[0];
} else {
if (i && points[i]) {
points[i].x += points[i].vx;
points[i].y += points[i].vy;
var cx:Number = points[i - 1].x;
var cy:Number = points[i - 1].y;
this.curveTo(cx, cy, (points[i].x + cx) / 2, (points[i].y + cy) / 2);
} else {
this.moveTo(points[i].x, points[i].y);
}
}
}
prev_xmouse = this._xmouse;
prev_ymouse = this._ymouse;
};
function randSet():Number {
return arguments[Math.floor(Math.random() * arguments.length)];
}
loop.this.movie();
I edited the code above.
I want it so when someone moves the mouse across the screen a color is coming out, say for three seconds its blue, then it blends to red (thats why i put alpha at 12) and obviously added the loop! So it does not stop
AskMen Mouse Trailing Effect
the canadian askmen site has a banner at the very top (Top 99 Women) and when you move your mouse over and around it, a neat little light trail follows the mouse.
any thoughts and direction on how to achieve this effect?
http://ca.askmen.com/tech_info/2008_feb/feb06.html
thanks!
Tracing The Outline With Trailing Effect.
Look at http://www.voxunity.com/adcons/en/. There is this white thing that goes along the dotted lines, lady etc with a smooth trailing effect. Does anyone know how to do this?
I can't seem to find a tutorial on it. Someone please help.
|