Click Here for the first part of this tutorial.
Well. It is a large movie clip that gets moved to specific coordinates every time a navigation bar button is pressed. Watch the tutorial and you will see!
CLICK HERE FOR A COMPLETE ACTIONSCRIPT 3.0 CARTOON SMART TUTORIAL
DOWNLOAD THE SOURCE FILE
DynamicMapNavigationFinal
HERE IS THE SOURCE CODE!
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
//The ActionScript 3.0 Flash Mini Site
// Avraham Saltoun
// solutions at say-web dot com
// FREE to USE, COPY and DISTRIBUTE
// Let's import the libraries we plan to use
import fl.transitions.Tween;
import fl.transitions.easing.*;
// the star states we will import
// all eases
// Now we will create a batch of variables
// that will store the coordinates for each
// area of our large movie clip
// each pair represents a "page"
var homeX:Number= 103; // We will check on stage
// the coordinate for x and y when button home is clicked
var homeY:Number= 47;
// Now the same for prices
var pricesX:Number= 694;
var pricesY:Number=-365;
// Now the same for Contact
var contactX:Number= -489;
var contactY:Number=-379;
//These variables will hold the Tween
// to be executed
var xTween:Tween; // holds the horizontal tween
var yTween:Tween; // holds the vertical tween
xTween = new Tween (main_mc,"x",Strong.easeInOut,main_mc.x,homeX,2,true);
yTween = new Tween (main_mc,"y",Strong.easeInOut,main_mc.y,homeY,2,true);
// Event Listeners
home_btn.addEventListener(MouseEvent.CLICK, navigate);
prices_btn.addEventListener(MouseEvent.CLICK, navigate);
contact_btn.addEventListener(MouseEvent.CLICK, navigate);
//Note that all buttons will lead to the same function
//The only difference is the values they will pass
//Functions
function navigate (event:MouseEvent):void {
if (event.target == home_btn)
{
setTween (homeX, homeY);
}
else
if (event.target == prices_btn)
{
setTween (pricesX, pricesY);
}
else
if (event.target == contact_btn)
{
setTween (contactX, contactY);
}
}
function setTween ( tweenX:Number, tweenY:Number) :void
{
//This retrieves the location of our large movie clip
//To be used as starting point of our desired tween
xTween.begin = main_mc.x;
yTween.begin = main_mc.y;
//This assigns the values passed from
// the navigate function as the end location
// of the tween
xTween.finish = tweenX;
yTween.finish = tweenY;
//After assigning values, this fires the tween
xTween.start();
yTween.start();
}
xTween.stop();
yTween.stop();
// Subscribe from the website! </div> |




February 5th, 2012 at 7:38 am
Good day, I necessary junction the administrator of this area! Waiting through despite an answer.
February 5th, 2012 at 12:18 pm
This blog spot has got some truly useful info on it! Through you as a service to informing me!
February 5th, 2012 at 3:34 pm
http://earnestbrown1211.over-blog.com/pages/diskursseissa-ilmestya-keleille-ryhtymykset-6558682.html
February 5th, 2012 at 8:07 pm
http://enriquekline49.skyrock.com/3066584191-Private-Student-Loan-Consolidation-Your-Answers-to-FAQs.html
February 6th, 2012 at 4:24 am
Thanks, useful material I added your blog to my bookmarks!…
February 6th, 2012 at 4:46 am
I almost accidentally visited to this site, but stayed here for a long time. Stayed because everything was very interesting. Surely will share with all my friends!…
February 6th, 2012 at 5:08 am
Totally agree with you, about a week ago wrote about the same in my blog..!
February 6th, 2012 at 5:33 am
Is anybody strong in radio here? We need a colleague who would tell us briefly about the transistor T2. I hope there are radio amateurs here. If it`s not on the subject at all, then I`m sorry. I have to write because I have no choice. PS: if the spelling is not right then also I’m sorry, I’m just 13 years old!…
February 6th, 2012 at 7:10 am
I was looking for the report in Yandex and suddenly came across this page. I found a little information on my topic of my report. I would like more, and thanks for that..!
February 6th, 2012 at 7:32 am
Author, Shoot yourself a knee..!
February 6th, 2012 at 7:55 am
Sent the first post, but it wasn`t published. I am writing the second. It’s me, the African tourist.
February 6th, 2012 at 8:18 am
Right from this article begin to read this blog. Plus a subscriber:D
February 6th, 2012 at 8:42 am
Of course, I understand a little about this post but will try cope with it!!…
February 6th, 2012 at 9:04 am
Well, actually, a lot of what you write is not quite true !… well, okay, it does not matter:D
February 6th, 2012 at 9:28 am
I serched through the internet and got here. What a wonderful invention of the mankind. With the help of the network you communicate, learn, read !… That helped us to get acquainted!…
February 6th, 2012 at 10:15 am
I am getting married on the 15th of November. Congratulate me! Then will be here rarely!…
February 6th, 2012 at 11:33 am
Received the letter. I agree to exchange the articles.
February 6th, 2012 at 11:57 am
Thanks a lot! An extremely interesting comment!!…
February 6th, 2012 at 11:57 am
I read and feel at home. Thanks the creators for a good resource..!
February 6th, 2012 at 12:19 pm
I subscribed to RSS, but for some reason, the messages are written in the form of some hieroglyph (How can it be corrected?!…
February 6th, 2012 at 12:44 pm
I`m so grateful that you enlightened me and the most important thing that it happened in time. Just think, I have been using the internet for six years already but it`s the first time I`ve ever heard about it!…
February 6th, 2012 at 12:54 pm
Keen website you pull someone’s leg here. Respect
February 6th, 2012 at 1:13 pm
Good day! I do not see the conditions of using the information. May I copy the text from here on my site if you leave a link to this page?!…
February 6th, 2012 at 1:39 pm
Pleased to read intelligent thoughts in Russian. I`ve been living in England for already 5 years!…
February 6th, 2012 at 2:06 pm
Yet, much is unclear. Could you describe in more details!…
February 6th, 2012 at 2:32 pm
It’s straight to the point! You could not tell in other words!
February 6th, 2012 at 3:00 pm
Interesting, but still I would like to know more about it. Liked the article:D
February 6th, 2012 at 3:00 pm
I am amazed with the abundance of interesting articles on your site! The author – good luck and wish you the new interesting posts..!
February 6th, 2012 at 3:27 pm
It’s straight to the point! You could not tell in other words!
February 6th, 2012 at 3:56 pm
I am amazed with the abundance of interesting articles on your site! The author – good luck and wish you the new interesting posts..!
February 6th, 2012 at 4:22 pm
A unique note..!
February 6th, 2012 at 5:19 pm
Thanks for the news! Just was thinking about it! By the way Happy New Year to all of you:D
February 6th, 2012 at 5:47 pm
Pleased to read intelligent thoughts in Russian. I`ve been living in England for already 5 years!…
February 6th, 2012 at 6:16 pm
This article is for professionals..!
February 6th, 2012 at 6:43 pm
Thanks:) Cool topic, write more often! You manage with it perfctly:D
February 6th, 2012 at 7:12 pm
Thank you, a very interesting note!!…
February 6th, 2012 at 8:07 pm
Well, actually, a lot of what you write is not quite true !… well, okay, it does not matter:D
February 6th, 2012 at 8:34 pm
Thanks a lot! An extremely interesting comment!!…
February 8th, 2012 at 10:10 am
Hi, the whole world who reads this blog – Jubilant Reconcilement and Accord. Burst forth originate is coming!
February 9th, 2012 at 5:04 am
http://leonrene98.lima-city.de/tickr/index.php/notice/583
February 9th, 2012 at 6:38 am
That’s a great post!
February 10th, 2012 at 5:52 am
http://ligatech-webservices.net/Jcow/index.php?p=blogs/viewstory/67372
February 11th, 2012 at 7:45 am
I would add something else, of course, but in fact almost everything is mentioned!…