LoadMovies To Line Up To Bottom Right Reg. Point? How?
Hello!!I've searched high & low & tested numerous methods - but no cigar for me so far...I'm having trouble with the following problem:I have a main.swf which uses the loadMovie method to bring in external swfs.I want the movies to all load in aligned to the bottom right.So the very bottom right corner of my extrnal swf lines up to the very bottom right of my main.swf.Is there an effective way?
KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 06-19-2007, 01:10 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Bottom Right Registration Points For LoadMovies?
Hello!!
I've searched high & low & tested numerous methods - but no cigar for me so far...
I'm having trouble with the following problem:
I have a main.swf which uses the loadMovie method to bring in external swfs.
I want the movies to all load in aligned to the bottom right.
So the very bottom right corner of my extrnal swf lines up to the very bottom right of my main.swf.
Is there an effective way?
Draw A Line From Any Point A To Any Point B Dynamically Through Actionscript
I am trying to make a file where there are several locations made on a map. If a person clicks on one location A and then another location B, there is a plane that flies from A to B and there are 2 text fields that get populated with the names of A and B destinations. This animation is scripted. I wanted to animate a dotted line from point A (from destination of the plane) to point B(to destination of the plane) through action script too so that there is a dotted line following the plane animation.
Thanks
Aneesha
The Bottom Line
I've published my movie as an html at 100% width and height, and I've also used this code in my html,
code:
<BODY marginwidth="0" marginheight="0" topmargin="0" leftmargin="0">
Can someone tell me how to get rid of this bottom margin?
have a look
http://keepitmovindesigns.com/KIM_load_test.html
Bottom Line ? Strech ?
HI all,
I have a question regarding full 100% fit flash pages ( full browser i mean ). OK, i know how to make a full browsfer web page but i saw on many sites that they add a bottom "line" to it, sometimes buttons are there, etc... I'm just curious with what code do they achieve to "attach" the line to the bottom and make it 100% W and it always stays at the bottom and streches when browser is resized.
Thanks
Biro
Drawing Line Dynamically From Point To Point
Here is what I am looking to do, I will try and be specific:
I would like to create an MC:
when loaded, draws a line dynamically from the first x/y point released on the stage to the next x/y point released, then from there to the next x/y point released, and so on. Creating a path from point to point, wherever you release. Tracing the path of the user (based on onRelease points).
This could be a closed set, where, for example, I would have 10 MC's on the stage that are all potential points for the line. The catch is that I want the user to define the order, selecting the MC's in any order and having a line drawn that traces the users selections.
Or it could allow the user to release anywhere within the parent MC.
I am moderately familiar with drawing a line dynamically, but don't know how to write what I am looking for.
Any help??
Thanks so much.
Help With Gray Line Showing At Bottom Of Animation
I cannot figure out why there is continually a gray line at the bottom of this particular animation. Everything seems to be lined up. Does anyone have any idea how I can fix it? I have attached the .fla file. Thanks in advance.
Importing FLV To Movieclip = Black Line At Bottom
In a way this question is a follow-up to a previous thread:
http://www.actionscript.org/forums/s....php3?t=120367
...but since the question is different, I thought I'd start a new thread.
I'm importing FLV's to movieclips, but they all get a black line at the bottom, for some strange reason.
Any idea on a good solution to that?
Thanks in advance,
Peran.
Bottom Line Of JPEG's Cut Off On Published Site - Why?
I have a bunch of jpeg's loaded into my site, and they are displayed correctly inside Flash (and Flash's preview), but when I export them, and upload them - the bottom line of each jpeg is cut off (on my computer and up on the web). This is a problem because I have a 1px border around all my images and the bottom border is cut off. Is there anyway to fix this? (or even better yet, is there some built-in Flash feature that puts borders around images?)
To see what I'm talking about, check in the 'BAND' section on the site:
www.rta.ssxh.net/sample/index.swf
FLASH MOVIE FILE SIZE..the Bottom Line
People have different opinions on how big the movie size (kb's) should be. Iv'e heard 300kb, 250kb, but Iv'e seen sites where the movie is 700kb. My target market is flash design, Kinda have mixed feelings on this.
Point A, To Point B... In A Straight Line?
Hello everyone, l'm working on a script that is similar to the old "missile command" game from the 80's, and l just got started.
In any event, the user Clicks on the screen which executes the
"fireMissile(_root._xmouse,_root._ymouse);" function. As you can see, this function duplicates my missile MC, and starts it off with the X/Y coordinates of: 273,312. From that point, l want the MC to move in a *straight line*, from it's starting point, to the point where the mouse *was* when the fireMissle() function was called.
I've ripped some code from one of my actionscript books, but l can't seem to fine tune the scripting correctly, and l'm getting all types of haywire effects that l'm not looking for. IE missiles going every which direction, but where I clicked the mouse.
here's the portion of the code where l'm running into problems... what's wrong here?
Code:
xdiff = x-startX;
ydiff = y-statY;
angle = Math.atan2(ydiff, xdiff);
angle = angle*180/Math.PI;
_root["missile"+missleCount]._x = startX;
_root["missile"+missleCount]._y = startY;
_root["missile"+missleCount].finalX = missleSpeed*Math.cos(angle);
_root["missile"+missleCount].finalY = missleSpeed*Math.sin(angle);
And the entire script (less some of the extra garbage that's been thrown in):
Code:
mouse.hide();
missleCount = 0;
startX = 273;
startY = 312;
missleSpeed = 5;
shotsOnScreen = 0;
maxShotsOnScreen = 100;
function fireMissle(x, y) {
duplicateMovieClip("missile", "missile"+missleCount, missleCount);
xdiff = x-startX;
ydiff = y-statY;
angle = Math.atan2(ydiff, xdiff);
angle = angle*180/Math.PI;
_root["missile"+missleCount]._x = startX;
_root["missile"+missleCount]._y = startY;
_root["missile"+missleCount].finalX = missleSpeed*Math.cos(angle);
_root["missile"+missleCount].finalY = missleSpeed*Math.sin(angle);
missleCount++;
shoutsOnScreen++;
}
and the code on the actual missleMC
Code:
onClipEvent (enterFrame) {
if ((finalX) && (finalY)) {
this._x += this.finalX;
this._y += this.finalY;
}
}
Point-to-Point Line-of-Site
Point-to-Point Line-of-Sight* Oops
Man that sounds so cool.
edit:
Since this original post I have learnt of the world of Raycasting. You can see my attempts of it in this post:
http://www.kirupa.com/forum/showthre...88#post1746388
Here's the script. I have used Flash 8's BitmapData and Rectangle classes, but the theory could easily be applied to another tile-based world without any of these, these classes were simply used to display everything.
Use the Arrow keys to move the character, and the character aims to the mouse position.
http://icio.co.uk/random/files/flash/sight.swf
ActionScript Code:
import flash.display.BitmapData;import flash.geom.Rectangle;Stage.scaleMode = "noScale";Mouse.hide();//*********************************************************// Variablesvar tileSize:Number = 10;var map:Array = [[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1], [1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1], [1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1], [1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]]; // This is an awesomely-long line, y0. (762 characters before comment)var baseBitmap:BitmapData = new BitmapData(map[0].length*tileSize, map.length*tileSize, false, 0xEEEEEE); _root.attachBitmap(baseBitmap, _root.getNextHighestDepth()); // var objBitmap:BitmapData = new BitmapData(baseBitmap.width, baseBitmap.height, true, 0x00000000); _root.attachBitmap(objBitmap, _root.getNextHighestDepth()); // |- The bitmaps used in the gamevar hitBitmap:BitmapData = new BitmapData(baseBitmap.width, baseBitmap.height, true, 0x0000FF00); _root.attachBitmap(hitBitmap, _root.getNextHighestDepth()); // /var tileRectangle:Rectangle = new Rectangle(0, 0, tileSize, tileSize); // A Rectangle object for drawing tiles onto the base bitmap.var objects:Array = []; // An array of all the objectsvar player:Object = {y:10*tileSize, x:1*tileSize, color:0xFFFF3399, xspd:0, yspd:0}; objects.push(player); // The player objectfor (y=0; y<map.length; y++) { for (x=0; x<map[0].length; x++) { if (map[y][x] == 1) { // Cycle through the numbers in the map and process, then tileRectangle.x = x*tileSize; tileRectangle.y = y*tileSize; // Reposition the tile rectangle baseBitmap.fillRect(tileRectangle, 0x999999); // Draw it onto the base bitmap} } }// Draw the objects onto the object bitmapfunction drawObjects() { objBitmap.fillRect(objBitmap.rectangle, 0x00000000); for (i in objects) { objBitmap.fillRect(new Rectangle(objects[i].x, objects[i].y, tileSize, tileSize), objects[i].color); } objBitmap.fillRect(new Rectangle(_xmouse-1, _ymouse-1, 3, 3), 0xFFFF0000); } //****************************************************************************************// THE IMPORTANT FUNCTION - THIS IS WHAT IT'S ALL ABOUT !! *******************************//****************************************************************************************function lineOfSite(x1:Number, y1:Number, x2:Number, y2:Number) { var dist:Number = Math.sqrt(Math.pow(x2-x1, 2)+Math.pow(y2-y1, 2)); // The distance from the start point to end point var angle:Number = Math.atan((y2-y1)/(x2-x1)); // The angle from start point to end point (in radians) angle += x2-x1<0 ? Math.PI : 0; // angle correction angle += x2-x1>=0 && y2-y1<0 ? 2*Math.PI : 0; // angle correction hitBitmap.fillRect(hitBitmap.rectangle, 0x0000FF00); // (Eye-Candy) var pos:Number = 0; // Where we're going to start from on the line while (pos < dist) { // Loop until we've tested further than, or to the same distance as, the total distance pos = pos+1<=dist ? pos+1 : dist; // Move onto the test position. (Increasing/Decreasing '1' increases/decreases accuracy) var x:Number = Math.floor(pos*Math.cos(angle)+x1); // Calculate the new x-coordinate for testing var y:Number = Math.floor(pos*Math.sin(angle)+y1); // Calculate the new y-coordinate for testing if (map[Math.floor(y/tileSize)][Math.floor(x/tileSize)] == 1) { // Check to see if the current point's relative tile is '1' or '0' break; // Exit the loop if the tile is a '1'. Upon exitting, `x` and `y` maintain the coordinates } hitBitmap.setPixel32(x, y, 0xFF666666); // (Eye-Candy) } hitBitmap.fillRect(new Rectangle((pos==dist?x2: x)-1, (pos==dist?y2:y)-1, 3, 3), pos==dist?0xFF0000FF:0xFF000000); // (Eye-Candy) return pos==dist; // Will return true if the target was reachable and false otherwise.}//****************************************************************************************//*********************************************************// Player Movement - Can't be assed commenting all of this.function movePlayer() { player.xspd += Key.isDown(Key.RIGHT)?1: (Key.isDown(Key.LEFT)?-1:0); player.xspd = Math.abs(player.xspd)>tileSize?tileSize*player.xspd/Math.abs(player.xspd):player.xspd; player.yspd += Key.isDown(Key.DOWN)?1: (Key.isDown(Key.UP)?-1:0); player.yspd = Math.abs(player.yspd)>tileSize?tileSize*player.yspd/Math.abs(player.yspd):player.yspd; if (!Key.isDown(Key.RIGHT) && !Key.isDown(Key.LEFT)) { player.xspd *= Math.abs(player.xspd)<0.1?0:0.8; } if (!Key.isDown(Key.UP) && !Key.isDown(Key.DOWN)) { player.yspd *= Math.abs(player.yspd)<0.1?0:0.8; } var xL:Number = Math.floor(player.x / tileSize); var xR:Number = Math.floor((player.x+tileSize-1) / tileSize); var yT:Number = Math.floor(player.y / tileSize); var yB:Number = Math.floor((player.y+tileSize-1) / tileSize); var maxL:Number = xL*tileSize; var maxR:Number = xR*tileSize; var maxU:Number = yT*tileSize; var maxD:Number = yB*tileSize; var cL:Boolean = !(map[yT][xL-1]==1 || map[yB][xL-1]==1); var cR:Boolean = !(map[yT][xR+1]==1 || map[yB][xR+1]==1); var cU:Boolean = !(map[yT-1][xL]==1 || map[yT-1][xR]==1); var cD:Boolean = !(map[yB+1][xL]==1 || map[yB+1][xR]==1); var xmove:Number = player.xspd; var ymove:Number = player.yspd; if (!cL && player.x+player.xspd < maxL) { xmove = maxL - player.x; player.xspd = 0; } if (!cR && player.x+player.xspd > maxR) { xmove = maxR - player.x; player.xspd = 0; } if (!cU && player.y+player.yspd < maxU) { ymove = maxU - player.y; player.yspd = 0; } if (!cD && player.y+player.yspd > maxD) { ymove = maxD - player.y; player.yspd = 0; } player.x += xmove; player.y += ymove;}// Call Everything_root.onEnterFrame = function() { movePlayer(); drawObjects(); lineOfSite(player.x+tileSize/2, player.y+tileSize/2, _xmouse, _ymouse); }
Dam, smilies make it difficult to post code
Update:
Problems upload .swf at the moment, so here's the .fla:
Line To A Point
Hey everyone,
Could someone share with me the basics of creating a dynamically generated line from one point to another AND have it arc. In otherwords, I dont want it to just create a straight line. I would like there to be an arc in doing so. Any help would be greatly apprecaited. Thank you
Don
Getting A Random Point On A Line
Is there a way to get a random point on a line. What I am trying to do is make a random spark that will travel between two paths. OS I want to be able to draw a random curved path on top and another random curved path on the bottom and have my electricity travel between the two paths. So I need to beable to get a random point on both lines.
Thanks in advance and if any one knows a good site that someone has dome this then please let me know. They have it on the Erain Web Site in the logo up top, but I want to beable to create this once and put it anywhere. Thanks again, Costa
Drawing A Line To Point To An Mc?
hi everyone,
how can i make a line draw from one movieclips central position to another movieclips position. so where ever i move one mc, the line points and stretches to it?
thanks for any advice.
Can You Add A Point To A Straight Line?
I can't seem to be able to do this, and it's extremely frustrating. Can you just add a vector point to a straight line that you've created in Flash? I can't get a + indicator using the pen tool on the line, I only get a O indicator.
Point-on-line Test
Does anyone know of a useful way to test if a movieclip is hitting any given point on a line?
Long time question, so any help would kick wild animals.
Moving One Point Of A Line
Hi-
I've tried several different approaches now on this problem, and I am at a loss...
I have multiple sprites of the same class(orbs) that each have multiple lines drawn to them from what I want to be stationary points. There are six possible stationary points, each stored in a Point variable.
The orbs drag and drop and I would like the lines associated from each orb to stay connected to their stationary point, but have the line essentially follow the orb. I had no problem drawing the original lines, just having them follow the orb. As of now the lines are NOT children of the orbs, but rather each set associated with a particular orb is stored in its own sprite.
I appreciate any conceptual guidance...
Thank you!
From Point To Animated Line
Hallo guys,
i need to draw some curves in diagram for my student job.
The curves should start from point, follow some path (combined from three, four parts) and finish it as the whole curve.
Could you help me with ideas how to do that. I am ocassionaly flash user, so I cannot guess it so easily
Thanx in advance.
Moving One Point Of A Line
So here's one for all you experts out there...
Let's say I draw a line in AS3:
Code:
var line:MovieClip = new MovieClip();
var container:MovieClip = new MovieClip();
container.addChild(line);
addChild(container);
line.graphics.lineStyle(3, 0x0000FFFF);
line.graphics.moveTo(200, 50);
line.graphics.lineTo(250,50);
Can I move JUST the starting point or the ending point? Something like this:
Code:
.
.
.
addEventListener(Event.ENTER_FRAME, moveIt);
function moveIt(e:Event):void {
line.startingPoint.x -=5;
}
Thoughts?
Calculating Point On A Line
Ok, this is the problem I'm trying to work out.
I have two movie clips on the stage which can be dragged around. Between each clip is a line which is permanently joined to each clip, so it stretches and moves with the two main movie clips.
Now when I click on the line, I attach a third movie clip. Now the lines goes from endclip1 to linepoint1 to endclip2. As the linepoint clip gets added, an array has the name of this clip added to it.
Everytime you click on the line, a new linepoint clip gets added to it, and the name gets added to the array which enables the line to be drawn from one clip to another.
Am I still making sense, stop me if i'm not....
This is fine while you are adding points that get closer to the endclip2, but when, for example, you add a point in the center of the two endclips then add another point between endclip1 and the center linepoint, the array will not be in the right order, so you'll get a line from endclip1 to linepoint1 (the one in the centre) to linepoint2 (closer to endclip1) to endclip2.
What I want to do is have the order go in order from one endclip to the other, instead of in the order they were created.
I hope you are still with me......
Now, think of it like a join the dots (that's not actually what I'm making) you might have several dots close to each other, but there is only one correct route, which is not necessarily the order of distance away from the end clips.
I think i'm starting to confuse myself now. Does anyone get what I'm on about? and if so, any ideas how i'd overcome the problem. It's for a flow chart builder, so you can get an idea about the two endclips (the flow chart symbols) and the linepoints (the route the line takes between each symbol) and the sort of layouts i'm trying to get.....
Jumping From A MC To A Point In The Main Line
Does anyone know how to jump from a Movie CLip to a point in the main time line? Or next scene even. I can't figure it out. I am building a preloader and I don't want the main timeline to loop while it figures out how much has been loaded because I want to run other clips on the main line and I don't want them to start over each iteration. Can anyone help? Thanks in advance
Stefan
Add Drag Resize Point To Line
I'm trying to make a room planner and are struggling with the shape of the walls.
I can drag the 4 corner points to resize the room but can't work out how to add a new point to the wall. Can anyone give us some script or point us in the direction of a nice shape editor source that would help? It must have the ability to add and drag new points to the shape.
Any help would be great! Thanks in advance.
Moving From One Point To Another On A Straight Line
how can I make one instance of a MC go to the same position as an instance of another MC on a straight line, and lets say, 5 steps?
I tried here, but it didnt work:
steps = 5;
conta;
itera;
TY = there._y;
TX = there._x;
distY = there._y-here._y/steps;
distX = there._x-here._x/steps;
if (conta == 12 and itera<=5) {
there._y = TY-distY;
there._x = TX-distX;
TY = there._y;
TX = there._x;
conta = 0;
itera++;
} else {
conta++;
}
place();
How Do You Draw A Line From Point A To B Dynamicly?
Hey, how do you draw a line from point A to B dynamicly? What I mean is, how do you draw a line on the screen that keeps changing acording to x1,y1, x2,y2?
Also, how do I fill in the lines to a solid color?
Moving In A Straight Line From One Point To Another
Hey everyone. I've got a simple question for you guys.
How do you move a movieclip from one point to another, directly in a straight line?
For example if I wanted it to move from 232,415 to 105,98
Any ideas?
Drag Point, Move Line
Hello
First - sorry of My English, I not use this language.
example :
http://studioatrium.pl/projekt-domu-...2,wymiary.html
Where find a tutorial is make this points to draw lines ?
I want create that point, and drag this, move line position.
This work of flash 8, Action Script 2
but Flash CS3, Action Script 3
wathewer
Zamotalem
dziekuje i pozdrawiam
MATH Distance To A Line From A Point
Hi Guys,
Does anyone know a function/formula for getting the distance from a point to a line (i.e. the closest point on the LINEAR line to the point).
It's really driving me nuts! I've found heaps of Math functions on the net, but I'm just not sure how to apply them in Flash...
Any help you wizards can provide would be awesome!
Thanks,
Lars
Drawing API - Clear Line Only A A Certain Point?
Hi eveyone,
is it possible to somehow use a the clear() function on a line that has been dynamically drawn only at a certain point? i need a line to be drawn and then gradually erased with time. currently i'm drawing a green line and then a few seconds later, a start up a function that creates a white line above it. it works great if this line is above a white background, but if it's above some other element, you see a white line
any thoughts?
MATH Distance To A Line From A Point
Hi Guys,
Does anyone know a function/formula for getting the distance from a point to a line (i.e. the closest point on the LINEAR line to the point).
It's really driving me nuts! I've found heaps of Math functions on the net, but I'm just not sure how to apply them in Flash...
Any help you wizards can provide would be awesome!
Thanks,
Lars
How Do I Get A Line To Pivot On It's End Point? Like A Clock.
I am trying to creat a tumbler for a raffel drawing. I can get the tickets to spin on the inside of the tumbler, but when I try to make the hadle spin it moves in a circle. What I want to do is have it pivot in place like the hands of a circle. I am new to flash and don't have a real grasp of the action scripting. Any assistance or a point in the right direction would be appreciated.
Thanks,
Jason
How To Animate Drawing A Line From Piont A To Point B?
I want to animate a line drawn from starting point A to finish point B, so far I have the following code that just displays a static vertical line at once, how can I animate the drawing motion?
ActionScript Code:
package {
import flash.display.MovieClip;
import flash.display.LineScaleMode;
public class VerticalLine extends MovieClip {
public function VerticalLine() {
graphics.lineStyle(1,0xfffdc5,.5,true);
graphics.moveTo(0,0);
graphics.lineTo(0,980);
}
}//end of class
}//end of package
Find A Point On A Dynamic Curved Line
Im generating a line dynamically to simulate a wobbling stack of books.
The image shows the line which the book stack will follow. however im struggling to find a simple method of snapping my books to the line.
Any suggestions?
Ways To Start Movie At A Certain Point In The Time Line?
im no expert with flash, i mostly update templatemonster templates but this one is driving me crazy.
It has a "intro" that out starts and i dont want that on every page. So i figure i can make a second file without the intro out starting, but no matter what i do it wont start at the right place in the time. no matter what from i put in the gotoAndPlay(XXXX) line it starts half way throught he movie.
wondering if there is something that wont let it go past that. There is a "skip" button that has the code of
on (release) {
gotoAndPlay(544);
}
but no matter where i put that, ont he loader, in the first frame it starts at around 200ish.
Any ideas or recs. on what i can try?
Moving A Point And Remaining A Path (line) Back
I want to move a point to a coordinate (_x,_y) and this point must go there slowly and create a path (line ) . After that the point must return and also slowly and the path must disapeare. Can You help me. I am a beginer.
I need to know an instruction used for delayng actions.
Bye.
Hi :) Need A Push In The Right Direction - API Drawing A Line To A Dynamic Point
Hello, I need to create a line that moves slowly towards a dynamically defined point.
I can create an MC that moves towards a dynamic point using:
Code:
onClipEvent (enterFrame) {
_root.yChange = Math.round(_root.targetY-this._y);
_root.xChange = Math.round(_root.targetX-this._x);
_root.yMove = Math.round(_root.yChange/20);
_root.xMove = Math.round(_root.xChange/20);
this._y += _root.yMove;
this._x += _root.xMove;
}
placed on the MC...where targetY and targetX are defined when the user clicks a particular point on the stage, but I can't figure out how to get the MC to 'draw' a line as it goes.
Be great if anyone could push me in the right direction. In the meantime I'll keep searching.
Thanks!
Drawing A Curved Line (trouble W/ Control Point)
I'm having a tough time trying to dynamically figure out what a control point should be between a start and end point. I would like to consistently get a soft curve between the two points. The ideal curve would look something like this:
http://www.actionscript.org/resources/content_images/4/steps.gif
My problem comes in when I need to figure out the math to get the control point (p1 in that graphic). I see a lot of code out there drawing a sine curve or something more detailed, but I'm getting lost when it's just one curve. Ideally, I think what I'm looking for is a function along these lines:
Code:
function drawCurvedLine(target_mc,startX,startY,endX,endY,curveAngle){
...
}
The "curveAngle" argument would be a degree like 30, 45, etc...
If anybody can help, I would appreciate it greatly. If I'm not thinking about this correctly, let me know.
Drawing A Curved Line (trouble W/ Control Point)
I'm having a tough time trying to dynamically figure out what a control point should be between a start and end point. I would like to consistently get a soft curve between the two points. The ideal curve would look something like this:
http://www.actionscript.org/resource...es/4/steps.gif
My problem comes in when I need to figure out the math to get the control point (p1 in that graphic). I see a lot of code out there drawing a sine curve or something more detailed, but I'm getting lost when it's just one curve. Ideally, I think what I'm looking for is a function along these lines:
ActionScript Code:
function drawCurvedLine(target_mc,startX,startY,endX,endY,curveAngle){
...
}
The "curveAngle" argument would be a degree like 30, 45, etc...
If anybody can help, I would appreciate it greatly. If I'm not thinking about this correctly, let me know.
LoadMovies
I have 6 swf files. The main movie is called main.swf. How do I preload/load the other swf's that I have. The swf's need to follow this specific flow.
Main.swf
Movie1.swf
Main.swf
Movie2.swf
Main.swf
Movie3.swf
Main.swf
Movie4.swf
Main.swf
Movie5.swf
Main.swf
Movie6.swf
The main.swf will control everything. The flow should be, launch main.swf, perform animation, load and play movie1.swf. Play movie1.swf once complete, go back to main.swf. This process will continue for movies 2-6. Any help would be greatly appreciated.
Asp Loadmovies
can i controll a flashmovie in a html / asp site and load another movie into the existing one by just using asp or html programming? target? links? please tell me if you know...
kind regards
pj
Loadmovies
ok, i have an swf i want to load into a movie clip. my main movie consists of two scenes - a preloader then the full site. on the stage in the main movie i have an empty movie clip with the instance name of 'tune' with this i want to load the swf called 'sounds1' into it. here is the script i have assigned to a button to load the movie..
code:
on(release) {
loadMovie("sounds1.swf",_root.tune);
}
why when the button is pressed does my movie take me back to my preloader scene? any ideas what i'm doing wrong?
cheers dudes.
LoadMovies
Hmm .. seems like i'm going backwards, i'm learning all the basics all over again. Anyways .. i'm trying to load another .swf file into the main .swf file ... and when it does this, it puts the top left corner of the small movie clip aligned to the center of the main movie clip when it loads it.
Is there a way to be able to position the movie clip another way?
Loadmovies
hi im trying to do the loadmovie action but when i puch the buttons the movie does not load where i want it to load in the midlle what am i doing wrong here is an example of how i want my movies to load every time i hit the buttons 2 advanced thank you
Layers And LoadMovies
i want to have a faster running site by using
buttons on "Layer 0" to call upon movies which
shall reside on "Layer 1" "Layer 2"......
not talking about Layers in the .fla timeline.
just want to know how these layers are defined
and in what environment.
Best Regards_
Using HitTest To LoadMovies
I'm using this code:
------------------------------------
onClipEvent (mouseUp) {
if (_root.status=this.hitTest(_root.mcDragA)) {
loadMovieNum ("guitar.swf", 5);
} else {
unloadMovieNum (5);
}
}
-------------------------------------
I have these sliders on my site that when u slide them up and if they collide with an object a movie clip plays.
I have three sliders (slider1, slider2, slider3), hence three movie clips that will play all at the same time if all sliders are moved in the up position.
But here is what happens. I slide one slider up, it loads the movie, great! but when i slide the second movie and my mouse button returns to the up position the first movie flickers and then starts the short clip over...Clip2 begins to play.
I had move my mouse off of the stage and click the mouse button and if all the sliders are in the up position all three movie clips will keep flickering (they turn off for as long as the mouse button is down and then come back on again when the mouse button is up)
what can i do to fix this problem?
Sequential Loadmovies
I have an animation as the base movie, and I'm trying to have it stop in certain places and load another swf, play it, then continue with the base movie, until it reaches the next stopping point, loads a movie, plays, and continues with base movie once again.
Basically I just need to know how to start the next load movie after I have played through the 1st load movie once.
Code:
frame1: loadMovie ( "loadme.swf", 3 );
frame3: _level3._x = 220;
_level3._y = 140;
stop();
And if you have even more time to answer, is there a way to limit the size of the movie loaded. By size I mean x pixels by y pixels big, no matter how big/small the original movie was made in. Kinda like an autofit.
Thanks
LoadMovies And Preloaders
Hey Guys,
I've just been asked by a friend to build a full site in flash. Due to content requirements I'm going to need to load in parts of the site as a user clicks on a navigation button. I know this is pretty standard fare, but could someone please tell me how to do this reliably and efficiently, especially with a preloader? Or could someone point me in the direction of a good tutorial?
Thanks much!
|