Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

zoom bar

Posted on 2009-02-21
13
Medium Priority
?
327 Views
Last Modified: 2013-11-11
Greeneel,
I'm finally getting back to my map project. I think the zoom bar will finish it off. The link you sent me was helpful, but I'm still a bit lost. I'm wondering if I should use the various increments that you helped me set up with the buttons to correspond with the various points along the zoom bar? or if a completly different method will be used with the zoom bar?

Bm71
0
Comment
Question by:Bm71
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 6
13 Comments
 
LVL 11

Expert Comment

by:Eaddy Barnes
ID: 23702876
using the scroll bar to correspond with certain point of the map zoom sequence sounds like a good idea.

GE
0
 
LVL 11

Assisted Solution

by:Eaddy Barnes
Eaddy Barnes earned 2000 total points
ID: 23703059
here how i would implement the scrolling for the tab to reflect the movement of the map.

sent an example of the script in working to your email.

GE


 
on (press) {
 
	startDrag(this, false, 0, 0, 81.2, 0);
 
	// startDrag(this, false, -631, -464, 0, 0);
}
 
 
on (release) {
 
	import mx.transitions.Tween;
	import mx.transitions.easing.*;
 
trace(this._x);
 
	if ((this._x>=0) && (this._x<8.5)) {
 
		trace("in the area");
		var paddle_X:Tween = new Tween(this, "_x", Strong.easeOut, this._x, -2.50, 1, true);
 
		var zoom_handlerX:Tween = new Tween(_root.mapall2, "_width", Strong.easeOut, _root.mapall2._width, 540.6, 2, true);
		var zoom_handlerY:Tween = new Tween(_root.mapall2, "_height", Strong.easeOut, _root.mapall2._height, 417.4, 2, true);
 
		contrainLeft = -184;
		contrainTop = -120.1;
	}
	stopDrag();
 
}

Open in new window

0
 

Author Comment

by:Bm71
ID: 23703102
Great. I'll keep setting up the code in that way. Another question I have is how do I add the drag parameters to this? Would I place the parameters in with each section of this code? If this is true could you show me how to add parameters to the section of code below?

Here's the section of code to size the map:            
var zoom_handlerX:Tween = new Tween(_root.mapall2, "_width", 849.5, 926.7, 2, true);
var zoom_handlerY:Tween = new Tween(_root.mapall2, "_height", 656.0, 715.6, 2, true);

Here's the drag parameter code:
startDrag(this, false, -631, -464, 0, 0)

Bm71
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 11

Assisted Solution

by:Eaddy Barnes
Eaddy Barnes earned 2000 total points
ID: 23703182
this is the conditions you will be changing.

        if ((this._x>=0) && (this._x<8.5))

basically  it looks for the location of the tab and depending on it location it will cause the map to zoom to a certain amount.

so the tab value reflects the points on bar. and the condition looks to see if the tab is close to a certain point. when it finds the

point the condition matches it will zoom to the parameters under that condition

you with me?

GE


0
 

Author Comment

by:Bm71
ID: 23703248
So do the conditions:       if ((this._x>=0) && (this._x<8.5))  get attached to the zoom bar? or are they are they attached to the main time line? or somewhere else?

Bm71
0
 
LVL 11

Assisted Solution

by:Eaddy Barnes
Eaddy Barnes earned 2000 total points
ID: 23703292


 
on (press) {
 
	startDrag(this, false, 0, 0, 81.2, 0);
 
	// startDrag(this, false, -631, -464, 0, 0);
}
 
 
on (release) {
 
	import mx.transitions.Tween;
	import mx.transitions.easing.*;
 
trace(this._x);
 
	if ((this._x>=0) && (this._x<3.2)) {  //
 
		trace("in the area");
		var paddle_X:Tween = new Tween(this, "_x", Strong.easeOut, this._x, -2.50, 1, true);
 
		var zoom_handlerX:Tween = new Tween(_root.mapall2, "_width", Strong.easeOut, _root.mapall2._width, 540.6, 2, true);
		var zoom_handlerY:Tween = new Tween(_root.mapall2, "_height", Strong.easeOut, _root.mapall2._height, 417.4, 2, true);
 
		contrainLeft = -184;
		contrainTop = -120.1;
	}
	stopDrag();
 
}

Open in new window

condition.jpg
0
 

Author Comment

by:Bm71
ID: 23703366
Ok. So it looks like the code goes on the map movie clip and the diagram is showing increments on the zoom bar?

I'm also making the assumption that the drag parameters: startDrag(this, false, 0, 0, 81.2, 0); are something I need to figure out. Right it seems as though these parameters just allow the movie clip to be dragged to the right. Correct?  

Bm71
0
 
LVL 11

Expert Comment

by:Eaddy Barnes
ID: 23703408
you sound good
now try making one
for the next level

GE

0
 

Author Comment

by:Bm71
ID: 23703417
Sorry, I overlooked the file you sent me. I'll play with that and get back to you in the morning.

Thanks,
Bm71
0
 

Author Comment

by:Bm71
ID: 23705238
GE,
I see how this code is placed on the zoom slider, but I'm having trouble setting up the next level.

 I tried stacking the conditions 1 on top of another like this:
if ((this._x>=0) && (this._x<9)) {
if ((this._x>=10) && (this._x<19)) {
if ((this._x>=20) && (this._x<29)) {


 I also tried attempted to stack sections of code like this:

trace(this._x);

      if ((this._x>=10) && (this._x<19)) {
            
            
            trace("in the area");
            
            var paddle_X:Tween = new Tween(this, "_x", this._x, -2.50, 1, true);
 
            var zoom_handlerX:Tween = new Tween(_root.mapall2, "_width", Strong.easeOut, 386.1, 463.4, 2, true);
            var zoom_handlerY:Tween = new Tween(_root.mapall2, "_height", Strong.easeOut, 298.1, 357.8, 2, true);


trace(this._x);

      if ((this._x>=20) && (this._x<29)) {
            
            
            trace("in the area");
            
            var paddle_X:Tween = new Tween(this, "_x", this._x, -2.50, 1, true);
 
      var zoom_handlerX:Tween = new Tween(_root.mapall2, "_width", Strong.easeOut, 463.4, 540.6, 2, true);
            var zoom_handlerY:Tween = new Tween(_root.mapall2, "_height", Strong.easeOut, 357.8, 417.4, 2, true);
      
      


All brought up errors in the output
Where am I going wrong?

Bm71  
0
 
LVL 11

Accepted Solution

by:
Eaddy Barnes earned 2000 total points
ID: 23706564
look a this peace of code with the next level in place.

GE


 
on (press) {
 
	startDrag(this, false, 0, 0, 81.2, 0);
 
	
}
 
 
on (release) {
 
	import mx.transitions.Tween;
	import mx.transitions.easing.*;
 
	trace(this._x);
 
	if ((this._x>=0) && (this._x<2.5)) {
 
		trace("in the area 1");
		var paddle_X:Tween = new Tween(this, "_x", Strong.easeOut, this._x, -2.50, 1, true);
 
		var zoom_handlerX:Tween = new Tween(_root.mapall2, "_width", Strong.easeOut, _root.mapall2._width, 540.6, 2, true);
		var zoom_handlerY:Tween = new Tween(_root.mapall2, "_height", Strong.easeOut, _root.mapall2._height, 417.4, 2, true);
 
		contrainLeft = -184;
		contrainTop = -120.1;
	}
	if ((this._x>=2.6) && (this._x<14.5)) {
		trace("in the area 2");
		var paddle_X:Tween = new Tween(this, "_x", Strong.easeOut, this._x, 9.50, 1, true);
 
		var zoom_handlerX:Tween = new Tween(_root.mapall2, "_width", Strong.easeOut, _root.mapall2._width, 617.8, 2, true);
		var zoom_handlerY:Tween = new Tween(_root.mapall2, "_height", Strong.easeOut, _root.mapall2._height, 477.1, 2, true);
 
		contrainLeft = -263;
		contrainTop = -180.1;
 
	}
	stopDrag();
 
}

Open in new window

0
 
LVL 11

Expert Comment

by:Eaddy Barnes
ID: 23706903


Are you making progress?

GE
0
 

Author Closing Comment

by:Bm71
ID: 31549671
GE
Sorry it took me a little wile to get back to this. I understanding it now! I'll let you know if I run into any additional problems on another question.

Thanks,

Bm71
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I know the transition can be hard. We got used to the ease of use ActionScript 2 had, but honestly, it became problematic later on, especially if designers were involved in the project and found it easy to add code as they saw fit. So, this artic…
Recently, I was asked to recommend a tracking system to be implemented on a clients website. As the entire site was built on flash, my first thought was to suggest custom built tracking system. However, our company at that point of time didn't h…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question