Solved

how can i jump to the location of a particular button inside a scroll pane

Posted on 2004-04-07
6
205 Views
Last Modified: 2010-04-03
Hi

i have a navigation bar and scroll pane on the stage.  Within the scroll pane i have a movie clip which doesn't really do anything but contains a bit of text and some buttons... the scroll pane only has a vertical scroll and not a horizontal so it's basically a list of information with the associated clickable logo (button) to the left of it.  I would like to have each submenubutton on the navigation bar show the relevant part of this information when pressed.  E.g. if options are A, B, C on menu and scroll pane automatically shows A (given that you must scroll down to see B and C as they are offscreen) I would like for the user to click on B and the B is shown in the scroll pane.  I think these are called anchors in html (not sure though) but I can't find any example in my flash textbook to help me do this.  The navigation bar is fully funtioning and set up and I plan to use the onpress and onrelease to jump to this page and show the user the appropriate selection... i've named the logos (buttons within the scroll pane) as i think this might help but don't know where to go from here! can this be done?

Thanks v. much.

Lee :O)
0
Comment
Question by:leemichellewilson
  • 2
6 Comments
 
LVL 19

Expert Comment

by:Montoya
ID: 10776863
Sounds like you want to use scrollpane.vposition("n")... where n is the positon for A, B, or C...

I'll post an example in a few minutes.
0
 
LVL 9

Accepted Solution

by:
krishnaprathab earned 125 total points
ID: 10781531
Hi,

 I have done a file with the exact requirment of yours and it works fine. Goto the following URL and click on the document icon. The file name is scrollpositioning.zip it has the source file and the swf file.

http://f2.pg.briefcase.yahoo.com/bc/pixellabz/vwp2?.tok=bc5AQQTBCmrALxYD&.dir=/Solutions&.dnm=Scroll+Positioning.zip&.src=bc

 The code is very simple , there is a movieclip which has a linkage identifier of sc in the library , the sc movie intuurn contains three movieclips whos instance names are a,b and c and there is a scrollpane in the timeline named my_sp. On the first frame of the timeline the action present is :

my_sp.setScrollContent("sc");

and there are three buttons named A,B and C and has the action :

For A:

on (release) {
      mcRef = _root.my_sp.getScrollContent();
      _root.my_sp.setScrollPosition(mcRef.a._x,mcRef.a._y);
}

for B it is :

on (release) {
      mcRef = _root.my_sp.getScrollContent();
      _root.my_sp.setScrollPosition(mcRef.b._x,mcRef.b._y);
}

and for C it is :

on (release) {
      mcRef = _root.my_sp.getScrollContent();
      _root.my_sp.setScrollPosition(mcRef.b._x,mcRef.b._y);
}

This works perfectly for me and will do for your too ;)

PN: Dont forget to align all the movielcips to the left-corner so that your x and y coordinates are perfect.

Hope this helps !

Thanks,
KP
0
 
LVL 9

Expert Comment

by:krishnaprathab
ID: 10824924
Hi,

Did my reply answer your question. If so please close this question or if you need some more help on this feel free to ask.

Thanks,
KP
0
 

Expert Comment

by:formi
ID: 24502432
in ActionScriot 3.0 you have to use

verticalScrollPosition=MyNewPosition

insted of setScrollPosition
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SCCM 2012 - Deploy Flash 16 7,024
FLV versus SWF 11 283
Im getting a black border top and bottom of any you tube videoes I look at. 3 63
Flash content not working in IE 11 on Windows 8.1 3 174
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…
I have found that much of my time doing support ends up being a constant repetition of the same steps to different people.  Early on I stated using web pages with Frequently Asked Questions (FAQs) to alleviate most of the burden.  Sometimes this jus…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
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.

856 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