Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Help in this Scrolling interface

Posted on 2006-06-16
5
Medium Priority
?
185 Views
Last Modified: 2010-04-03
i am implementing a scrolling interface for our online portfolio. Pls see a temp link here: http://www.adventmatrix.com/website/advent.html

In this I am facing a couple of problems:
1. If you go to the extreme sides, the scrolling goes past the "outer" edges of the graphic, and I cant seem to manage this. Is there a better way to implement this?

2. Is there also a way to control the speed of scrolling motion?

Look fwd to your responses.

Thks
zom
0
Comment
Question by:zombeen
  • 2
5 Comments
 
LVL 7

Expert Comment

by:furmiga
ID: 16923555
As I can see you are scrolling a big MC by reversing the mouse position and multipling for a base value that fits the size of your MC, changing its _x position. All this in a mask.

I might have an idea:

In the place that you added the script, put a conditional situation to this happen like:

Supose that the max left _x you want is -300 (lower then this its going to past the edge)

if (the_result_of_my_var_that_will_set_the_new_x_position > -300)
{
     my_big_mc._x = the_result_of_my_var_that_will_set_the_new_x_position
}
else
{
    my_big_mc._x = -300 // you just don't let it going further
}

now supose that max right _x position is 100. just do the same

if (the_result_of_my_var_that_will_set_the_new_x_position <100)
{
     my_big_mc._x = the_result_of_my_var_that_will_set_the_new_x_position
}
else
{
    my_big_mc._x = 100 // you just don't let it going further
}

This will probably solve your problem.
0
 
LVL 2

Author Comment

by:zombeen
ID: 16923766
Thanks fot your comment.

Here is what I am using

onClipEvent (mouseMove) {
_root.menu._x = (165-_xmouse)*0.666666+5;
}

I tried resticting the motion so that it stops scrolling at the 2 exrtreme ends of the graphic. Also i just could not manage the speed with this bit of code.
0
 
LVL 7

Accepted Solution

by:
furmiga earned 500 total points
ID: 16924174
The scrolling speed of your MC will variate according with its size (width). Larger MC's will scroll faster, after all, you need to cover the hole width by the space of the screen.

Change the name "menu" of your MC to something like "mymc" cuz "menu" is a reserved name.

Now, i can see that when you get close to the edges the movie stays good. the only problem is when the mouse goes off the "show area"

so to solve this try this code:

onClipEvent (mouseMove)
{
      if((_xmouse > -1) and (_xmouse < 1201)) // where 1200 is the width of my MC here. put your MC width here +1
      {
             _root.mymc._x = (143-_xmouse)*0.666666+5; // i used 143 to work here dunno if you have to change to fit yours MC
      }
}
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

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

This article describes a solution to a problem of subloading one movie into another when they have different SWF versions. Sometime back, I was working on an ActionScript project while I came across an interesting fact which I would like to share…
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
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 how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.
Suggested Courses

972 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