View Full Version : Professional Map Core Problem - professional AS3 Programmers
damas
March 12th, 2010, 08:08 AM
Hello everybody,
i need help from professional AS3 Programmers
i have flash map that contains 4 movies (vectors) that shown in levels
Map1 from level 0 to 10 (size width = 46,000 px . height = 46,000 px)
Map2 from level 10 to 20(size width = 46,000 px . height = 46,000 px)
Map3 from level 20 to 30(size width = 46,000 px . height = 46,000 px)
Map4 from level 30 to 40(size width = 46,000 px . height = 46,000 px)
i am using scale x,y for maps to zoom in and zoom out - by using visible = false and true,
and i have more than 10,000 movieclips like streets and other icons ( all of them text and vectors) and they are displaying the same of map by levels
My Problem in performance - when zoom in or out it's very SLOW
and the code working 100%
any suggestion please to solve the problem??
another problem: the flash player and flash stage limit property of position like x= 1000.05 , 1000.05, i am trying to adapt the position like x=1000.06 , y = 1000.02
the flash automatic make the value x= 1000.1 and y 1000
i am adapting the position of icon in the same map by clicking on the icon and move it as i want
in zoom in in high level, small value it's very important
example: name of street on the street line, 0.01 difference it move the name of street away from the street line.
notes:
- i am using as3
- nothing in timeline - all by coding
- object oriented
- all of icons from database by using Json and php and xml
please see the attached image
IQAndreas
March 12th, 2010, 10:33 AM
Wow...
My first recommendation would be to use BitmapData instead, but it might not show up as nicely when scaling. Still, try to "bitmap draw" as many items as possible. Perhaps if you scale in small increments, you can scale up the items as bitmaps, and redraw to make them "clearer" once the scale is up to where you want it.
Here is a great beginning tutorial on that:
http://gamedev.michaeljameswilliams.com/2010/02/28/blitting-movie-clips-flash-as3/
I'm not sure if Adobe is smart enough to not render items that are "off-stage" and not visible, but it might be a good idea to remove items from the display list that are too far away from the stage, and re-add them only when they are needed.
You should probably also break apart those large MovieClips on some way. It doesn't have to be exact, just a crude
As for your accuracy problem, if instead of setting the "scaleX" and "scaleY" properties, perhaps have a "scale" variable and redraw the lines etc. For example:
graphics.lineTo(34.2 * scale, 56.8 * scale);
And then always have the scaleX and scaleY set to 1.
If you tween in the scale, it would be inefficient to redraw all lines every time the value updates, so have the scaleX and scaleY values of the MovieClip tweened up temporarily. Once the value is what you want it at, reset the scaleX and scaleY back to 1, and redraw all lines to what values they are when you modify your "scale multiplier" variable. The users might notice a small "jump" now and then as items are positioned more accurately, but this shouldn't be worried about.
On that note, are you using TweenLite? NEVER AGAIN use the builtin Tween class! :td:
Finally, for the items that only contain vector drawings, (I'm guessing you are drawing the data to them at runtime instead of having library assets) it might help if you, unless you really need the items to have children or other graphics contained in them, to use "Shape" objects instead, which are basically stripped down versions of MovieClip and Sprite (actually, those two sortof subclass Shape)
I'm not really a professional, but hopefully my thoughts have helped a bit. :)
If you want me to explain anything better or give actual code examples, just ask.
notes:
- i am using as3
- nothing in timeline - all by coding
- object oriented
http://msp253.photobucket.com/albums/hh80/45chel/Smilies%20etc/worship.gif
damas
March 12th, 2010, 06:02 PM
Wow...
My first recommendation would be to use BitmapData instead, but it might not show up as nicely when scaling. Still, try to "bitmap draw" as many items as possible. Perhaps if you scale in small increments, you can scale up the items as bitmaps, and redraw to make them "clearer" once the scale is up to where you want it.
Here is a great beginning tutorial on that:
http://gamedev.michaeljameswilliams.com/2010/02/28/blitting-movie-clips-flash-as3/
I'm not sure if Adobe is smart enough to not render items that are "off-stage" and not visible, but it might be a good idea to remove items from the display list that are too far away from the stage, and re-add them only when they are needed.
You should probably also break apart those large MovieClips on some way. It doesn't have to be exact, just a crude
As for your accuracy problem, if instead of setting the "scaleX" and "scaleY" properties, perhaps have a "scale" variable and redraw the lines etc. For example:
graphics.lineTo(34.2 * scale, 56.8 * scale);
And then always have the scaleX and scaleY set to 1.
If you tween in the scale, it would be inefficient to redraw all lines every time the value updates, so have the scaleX and scaleY values of the MovieClip tweened up temporarily. Once the value is what you want it at, reset the scaleX and scaleY back to 1, and redraw all lines to what values they are when you modify your "scale multiplier" variable. The users might notice a small "jump" now and then as items are positioned more accurately, but this shouldn't be worried about.
On that note, are you using TweenLite? NEVER AGAIN use the builtin Tween class! :td:
Finally, for the items that only contain vector drawings, (I'm guessing you are drawing the data to them at runtime instead of having library assets) it might help if you, unless you really need the items to have children or other graphics contained in them, to use "Shape" objects instead, which are basically stripped down versions of MovieClip and Sprite (actually, those two sortof subclass Shape)
I'm not really a professional, but hopefully my thoughts have helped a bit. :)
If you want me to explain anything better or give actual code examples, just ask.
http://msp253.photobucket.com/albums/hh80/45chel/Smilies%20etc/worship.gif
Hello IqAndreas (http://www.kirupa.com/forum/member.php?u=134305),
thank you for you advice
i will give you link soon to see the map
thanks again
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.