# Tutorial maybe?

**URL:** <https://forum.kirupa.com/t/tutorial-maybe/4650>\
**Category:** flash\
**Created:** [August 15, 2002, 7:53am UTC](https://forum.kirupa.com/t/tutorial-maybe/4650 "2002-08-15T07:53:20Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jubba](https://avatars.discourse-cdn.com/v4/letter/j/90ced4/32.png) [@Jubba](https://forum.kirupa.com/u/Jubba)\
**Post date:** [August 15, 2002, 7:53am UTC](https://forum.kirupa.com/t/tutorial-maybe/4650/1 "2002-08-15T07:53:20Z")

</div>

Hey all, its been a while since I actually have written a tutorial, and I just figured out how to do an effect, its very basic, but if anyone would be interested in a tutorial, then I might as well write one up for it. Only takes about 10 minutes to actually achieve the effect…

\<embed src=“[http://www.livetoskateboard.com/flash/PomMoving.swf](http://www.livetoskateboard.com/flash/PomMoving.swf)” height=200 width=400\>\</embed\>

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 15, 2002, 8:18am UTC](https://forum.kirupa.com/t/tutorial-maybe/4650/2 "2002-08-15T08:18:42Z")

</div>

Hey, do you know I’ve never done that? Duplicate trailers I did, no prob, but I’ve never done this one… It’s the one where the elements position depending on the previous element, right?. And, hue… can I have a sneak preview at the code you’re using?

pom :asian:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 15, 2002, 10:38am UTC](https://forum.kirupa.com/t/tutorial-maybe/4650/3 "2002-08-15T10:38:59Z")

</div>

yeah… pretty cool. I’ve seen it done in javascript… but I haven’t seen anyone do it in Flash. I’m sure someone has, but I haven’t seen it.

Post the code… post the code. 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 15, 2002, 2:02pm UTC](https://forum.kirupa.com/t/tutorial-maybe/4650/4 "2002-08-15T14:02:30Z")

</div>

The code uses MX elements, but it wouldn’t be that difficult to reproduce in Flash 5. My code is also pretty ghetto, i was wondering if anyone had a way of cleaning it up a bit…

```auto

_root.onLoad = function () {
	//variables
	nSpace = 10;
	xStart = _root._xmouse;
	yStart = _root._ymouse;
	text = "Kirupa.com";
	nFriction = 3;
	//creates the balls
	for (ii = 0; ii < length (text); ii++) {
		//attach Movies from Library
		attachMovie ('ball', 'copy' + ii, 1 - ii);
		ext = _root['copy' + ii];
		prt = _root['copy' + (ii - 1)];
		//Use substr to call the text from the string
		ext.text = text.substr (ii, 1);
		if (ii == 0) {
			ext._x = xStart;
			ext._y = yStart;
		} else {
			ext._x = xStart + (30 * ii);
			ext._y = _root['copy' + (ii - 1)]._y;
		}
	}
};
_root.onEnterFrame = function () {
	//For Loop to move the balls
	for (ii = 0; ii < length (text); ii++) {
		//Defines ext and prt. Makes Code easier to write.
		ext = _root['copy' + ii];
		prt = _root['copy' + (ii - 1)];
		//checks the extetion _root.copy(ii) then tells them what to do.
		if (ii == 0) {
			ext._x += (_root._xmouse - ext._x) / nFriction + nSpace;
			ext._y += (_root._ymouse - ext._y) / nFriction;
		} else {
			ext._x += (prt._x - ext._x) / nFriction + nSpace;
			ext._y += (prt._y - ext._y) / nFriction;
		}
	}
};

```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 16, 2002, 12:36am UTC](https://forum.kirupa.com/t/tutorial-maybe/4650/5 "2002-08-16T00:36:09Z")

</div>

definitly I would love to see a tutorial for that…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 16, 2002, 10:09pm UTC](https://forum.kirupa.com/t/tutorial-maybe/4650/6 "2002-08-16T22:09:26Z")

</div>

cool!!!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 17, 2002, 5:39am UTC](https://forum.kirupa.com/t/tutorial-maybe/4650/7 "2002-08-17T05:39:54Z")

</div>

Nice coding there sir.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 17, 2002, 5:45pm UTC](https://forum.kirupa.com/t/tutorial-maybe/4650/8 "2002-08-17T17:45:21Z")

</div>

I don’t have much time to spend with my computer so I won’t be able to write the tutorial up until maybe next week sometime, but I’ll let you all know when its finished.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 19, 2002, 2:39am UTC](https://forum.kirupa.com/t/tutorial-maybe/4650/9 "2002-08-19T02:39:32Z")

</div>

Yep, nice code. Actually, I came up with something quite different. I’ll post the code when I can access this site from my computer, it can be interesting.

A few remarks about your code though:

```auto
// No need to define _root.onLoad
//variables
nSpace = 10;
xStart = _root._xmouse;
yStart = _root._ymouse;
// text is a keyword. There won't be an error, but 
// it's better to avoid that
sText = "Kirupa.com";
nFriction = 3;
//creates the balls
for (ii = 0; ii < sText.length; ii++) {
	//attach Movies from Library
	ext=attachMovie ('ball', 'copy' + ii, 1 - ii);
// Any reason why you attach at depth 1-ii?
	prt = _root['copy' + (ii - 1)];
	//Use substr to call the text from the string
	ext.text = sText.substr (ii, 1);
	if (!ii) {
		ext._x = xStart;
		ext._y = yStart;
	} else {
		ext._x = xStart + (30 * ii);
		ext._y = prt._y;
	}
}

_root.onEnterFrame = function () {
	//For Loop to move the balls
	for (ii = 0; ii < sText.length; ii++) {
		//Defines ext and prt. Makes Code easier to write.
		ext = _root['copy' + ii];
		prt = _root['copy' + (ii - 1)];
		//checks the extetion _root.copy(ii) then tells them what to do.
		if (!ii) {
			ext._x += (_root._xmouse - ext._x) / nFriction + nSpace;
			ext._y += (_root._ymouse - ext._y) / nFriction;
		} else {
			ext._x += (prt._x - ext._x) / nFriction + nSpace;
			ext._y += (prt._y - ext._y) / nFriction;
		}
	}
};

```

pom :asian:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 21, 2002, 6:16pm UTC](https://forum.kirupa.com/t/tutorial-maybe/4650/10 "2002-08-21T18:16:51Z")

</div>

Yeah i knew there was no reason to use ‘\_root.onLoad’ I just felt like throwing it in…

I meant to use (10-ii) because that way the first letter is always on top when you drag, because sometimes they overlap and the K would get sent to the bottom…if you use 10-ii then the K has the highest depth and it will stay on top.

meant to put nText…I was in a rush 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 23, 2002, 12:00pm UTC](https://forum.kirupa.com/t/tutorial-maybe/4650/11 "2002-08-23T12:00:30Z")

</div>

Arghh!! I can’t access this board from my computer. Can you send me a mail at [pom2ter93@hotmail.com](mailto:pom2ter93@hotmail.com) and I’ll send you my file so that you can compare.

pom :asian:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 26, 2003, 9:08pm UTC](https://forum.kirupa.com/t/tutorial-maybe/4650/12 "2003-01-26T21:08:49Z")

</div>

where is exactly the tutorial for this one i need to learn how the codes work can someone explain me by detail please

// No need to define \_root.onLoad  
//variables  
nSpace = 10;  
xStart = \_root.\_xmouse;  
yStart = \_root.\_ymouse;  
// text is a keyword. There won’t be an error, but  
// it’s better to avoid that  
sText = “[Kirupa.com](http://Kirupa.com)”;  
nFriction = 3;  
//creates the balls  
for (ii = 0; ii \< sText.length; ii++) {  
//attach Movies from Library  
ext=attachMovie (‘ball’, ‘copy’ + ii, 1 - ii);  
// Any reason why you attach at depth 1-ii?  
prt = \_root[‘copy’ + (ii - 1)];  
//Use substr to call the text from the string  
ext.text = sText.substr (ii, 1);  
if (!ii) {  
ext.\_x = xStart;  
ext.\_y = yStart;  
} else {  
ext.\_x = xStart + (30 \* ii);  
ext.\_y = prt.\_y;  
}  
}

\_root.onEnterFrame = function () {  
//For Loop to move the balls  
for (ii = 0; ii \< sText.length; ii++) {  
//Defines ext and prt. Makes Code easier to write.  
ext = \_root[‘copy’ + ii];  
prt = \_root[‘copy’ + (ii - 1)];  
//checks the extetion \_root.copy(ii) then tells them what to do.  
if (!ii) {  
ext.\_x += (\_root.\_xmouse - ext.\_x) / nFriction + nSpace;  
ext.\_y += (\_root.\_ymouse - ext.\_y) / nFriction;  
} else {  
ext.\_x += (prt.\_x - ext.\_x) / nFriction + nSpace;  
ext.\_y += (prt.\_y - ext.\_y) / nFriction;  
}  
}  
};

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 26, 2003, 9:10pm UTC](https://forum.kirupa.com/t/tutorial-maybe/4650/13 "2003-01-26T21:10:41Z")

</div>

I never made the tutorial. I haven’t had time. The code is commented and its pretty self-explanitory…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 26, 2003, 9:18pm UTC](https://forum.kirupa.com/t/tutorial-maybe/4650/14 "2003-01-26T21:18:49Z")

</div>

[http://www.flashkit.com/movies/Scripting/Physics/Artifici-Luis\_Pab-5091/index.php](http://www.flashkit.com/movies/Scripting/Physics/Artifici-Luis_Pab-5091/index.php)

Fantastic example of this…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 26, 2003, 9:50pm UTC](https://forum.kirupa.com/t/tutorial-maybe/4650/15 "2003-01-26T21:50:28Z")

</div>

First: OLD THREAD OLD THREAD OLD THREAD!!! (just for those people that didn’t know that)

Second: Wow that example is awesome. Thanks for posting that Llyd. It is a bit different, but still cool.

I did a rendition of this from Jubbas code a while back, here was my version:

[http://8ballcreations.com/lostinbeta/experimental/duptrailer.html](http://8ballcreations.com/lostinbeta/experimental/duptrailer.html)
