Mailing List
Home
Flash Pro
Extending Flash
Flash Macromedia Developer
Subjects
Firework Effect
setInterval bug identified and fixed
setInterval bug identified and fixed
ScrollPane component doesn 't auto update
Help: MX 2004 How to script a print button to print the entire sli
Event Dispatcher between classes
memory management removeMovieClip /
MX2004 Dataset itemClassName
Order of events per frame
XML to Object help
Textfield prototype question
Flash and QuickTime VR
Reading and displaying RSS feeds in Flash MX
Flash MX 2004 Sucks
AW: [Flashcoders] Switch/Case vs If/else
AW: [Flashcoders] Switch/Case vs If/else
Flash Interface with 10mb xml file
Web Service Results
Listener Object 's best practice
 
Search:  
Power your search with and, or, +, -, or "some phrase" operators.
center/printing

center/printing

2004-08-09       - By James Rolland

 Back

Hello,

I have a viewport inside of _root.mc. This viewport also contains other movieclips. So the structure is:
_root.viewport_mc.element_mc1
_root.viewport_mc.element_mc2
...
_root.viewport_mc.element_mcn


I am trying to make a viewport effect like you see in VISIO. I 've included the ability to drag/drop the viewport as well as drag/drop particular elements). I also added the ability to zoom (scale) in and out. I wanted to make the zooming occur in the middle of the screen each time. To accomplish this I started out with the registration point being in the center of the screen and then I did this:


_root.viewport_mc.onMouseDown = function(){
dragListX = this._x;
dragListY = _root.list_mc._y;
}
_root.viewport_mc.onMouseUp = function(){
_root.list_mc._visible = false;

//move list_mc back to the center of the screen
_root.list_mc._x = dragListX;
_root.list_mc._y = dragListY;

//now move all elements to the correct position
//based on the deltas
for(var mc in _root.viewport_mc) {
_root.viewport_mc[mc]._x += deltaX;
_root.viewport_mc[mc]._y += deltaY;
}
viewport_mc._visible = true;
}

This assures that the registration point is always in the center. The problem that I am having deals with printing. I do not know where to start the printing at. I cannot start at niewport_mc._x/y since that value is the center of the screen, not the resulting elements in the viewport. What about looping through all the elements in the viewport whenever the print command is called:


i.e.
var Xpos = 10000;
Var Ypos = 10000;
For (var mc in _root.viewport_mc) {
if (_root.viewport_mc._x < Xpos) {
Xpos = _root.viewport_mc._x;
}
if (_root.viewport_mc._y < Ypos) {
Ypos = _root.viewport_mc._y;
}
}

I haven 't tried it, but I don 't think that this is the route that I should go...I would be very grateful for some help on this because I am sort of new to flash and especially the whole viewport inside of a window thing...

Thank you -
Frank

      
-- ---- ---- ---- ---- ---- -----
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!

[Non-text portions of this message have been removed]



-- ---- ---- ---- ------ Yahoo! Groups Sponsor -- ---- ---- ---- --~-- >
Yahoo! Domains - Claim yours for only $14.70
http://us.click.yahoo.com/Z1wmxD/DREIAA/yQLSAA/IHFolB/TM
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -----~- >

=========================
Pro_Flash: Professional Web Developers Using Macromedia Flash
To subscribe: mailto:pro_flash-subscribe@(protected)
To UNSUBSCRIBE: mailto:pro_flash-unsubscribe@(protected)

Yahoo! Groups Links

<* > To visit your group on the web, go to:
http://groups.yahoo.com/group/pro_flash/

<* > To unsubscribe from this group, send an email to:
pro_flash-unsubscribe@(protected)

<* > Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/