Welcome to Egypt Forums Mark forums read | Egypt Main Page
Egypt Forums
Arabic Movies



Articles Thread, Lesson : Window Component in Flash; Lesson : Window Component In this tutorial, I will teach you how to use Window component. In window component you ...

Short Link: http://forum.egypt.com/enforum/showthread.php?t=5057


Reply
LinkBack Thread Tools Display Modes
Lesson : Window Component
 
 
The God Father
Developer's Avatar

Reply With Quote
 
Join Date: Jul 2008
Location: NDC
Posts: 5,425
23-10-2008, 02:43 AM
 
Egypt.Com EnForumLesson : Window Component

In this tutorial, I will teach you how to use Window component. In window component you can load MovieClips or even another SWF files.
Egypt.Com EnForum Flash 8, AS 2.0

Output:



Egypt.Com EnForum Download Source Files

Step 1: Open new Flash Document.

Step 2: Open components panel (Ctrl + F7) or Windows -> Components.

Egypt.Com EnForum

Step 3: In components panel under User Interface, you can find Window component.

Step 4: Click and drag the window component on to your stage.

Step 5: Left click on the window component and open the properties panel (Ctrl + F3) and give "win" as instance name.

Step 6: Now create a simple Movieclip with some little animation in it.

Step 7: Open the Library (Ctrl + L), right click on the Movieclip and select Linkage.

Step 8: In Linkage Properties window, check Export for ActionScript. Give "ani" as identifier.

Egypt.Com EnForum

Step 9: This Movieclip will be our content of our window.

Step 10: Now click the first frame and open the Actions panel (F9), and paste the below code in it.

win.title = "Sample Window";
win.closeButton = true;
win.contentPath = "ani";
win.setSize(250,200);

var listener:Object = new Object();
listener.click = function(){
win._visible = false;
}
win.addEventListener("click",listener);


Code Explanation:

win.title = "Sample Window";

You can assign title to your Window component.


win.closeButton = true;

By default the close button on the right top corner is false, to enable the close button we must initialize it to "true".

win.contentPath = "ani";

It is used to place the content inside the window component, where "ani" is a movieclip.


win.setSize(250,200);

It is used to set the width and height of the window component. The first parameter is width and second one is height. The height parameter also includes the height of the title bar which is 25px, so we must always add 25px to our height.



var listener:Object = new Object();
listener.click = function(){
win._visible = false;
}
win.addEventListener("click",listener);


In here we are adding Event Listener to the close button, when the user clicks on the close button the window visibility is switched to false.

- End of Tutorial!
__________________
I Love Walking In The Rain Cuz Nobody Know I'm Crying !!
 
 
 
Reply

Articles Thread, Lesson : Window Component in Flash; Lesson : Window Component In this tutorial, I will teach you how to use Window component. In window component you ...

Short Link: http://forum.egypt.com/enforum/showthread.php?t=5057


Bookmarks

Tags
component, lesson, window


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[HTTP] Madotate - FREE 3D window organizer Developer Software and Programs 0 20-10-2008 07:40 PM
Implementing Click-To-Seek For The FLVPlayback Component SABRAWY Flash Media Server 0 17-09-2008 08:29 AM
Pro Desk Support [Joomla Component] Developer Extensions 0 18-08-2008 09:24 PM
Cache accelerate component for Joomla, Mambo Developer Templates for Joomla 1.5 0 18-08-2008 08:42 PM
Using the Flash FLVPlayback Component in Flex 2.01 SABRAWY Flex 1 20-11-2007 04:16 PM