Solved

scroll image & text within a small boundary

Posted on 2003-11-30
7
7,613 Views
Last Modified: 2013-12-24
hi, i've an image which i wanna put within a small rectangle (boundary) for scrolling. the boundary is very much smaller than the size of the movie (small box). the reason i'm doin dis is to scroll a text with pics in it.

somehow, the examples i see out there uses boundaries as big as the screen, which isn't wat i wanted, bcos the image should be seen only inside dat small rectangle, especially when scrolling it. plz help.


gildan2020
0
Comment
Question by:gildan2020
  • 4
  • 3
7 Comments
 
LVL 20

Expert Comment

by:MediaMacros
ID: 9850445
There are a few ways to do this....

1. Use imaging lingo.  By getting the image of the text and the image of hte bitmap you can create a larger image object in RAM, then as you "scroll" use copy pixels to copy that portion of the image to the bitmap on the stage.
2. Use a MIAW.  You can open this in another Director window and set the drawRect of that window to "scroll" it.
0
 

Author Comment

by:gildan2020
ID: 9855553
yup, i've thought about doing MIAW, which is a good idea...

but how do i use imaging lingo? can u explain further?
is it possible to have a scrollbar with it?


gildan2020
0
 
LVL 20

Expert Comment

by:MediaMacros
ID: 9858390
Sure.  The basic idea is to use a small bitmap on screen as sort of a viewer for a small part of a larger image.  Fisrt create the larger image.  Use a new image object to composite the text and image together into one image.  Then we set the scroll...

scrollH = 0
scrollV = 0

so if we scroll 10 pixels left then scrollH = 10, and if we scroll 20 pixels down then scrollV = 20 so we cna copy this part of hte image in...

member("viewer").image.copyPixels(compositeImage, member("viewer").rect, member("viewer").rect.offset(scrollH, scrollV))

This copies that chunk of the main image into the viewer member.  THere are custom scrollbar behaviors at www.mediamacros.com that can be tied in or you can use an Xtra like OS Control to get OS level slider bars.
0
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

 

Author Comment

by:gildan2020
ID: 9858884
hmm...u said "Use a new image object to composite the text and image together into one image", are u saying dat i've to create an image which will house both my text and images? so, i'll b just scrolling an image instead, right?

if so...
member("viewer").image.copyPixels(compositeImage, member("viewer").rect, member("viewer").rect.offset(scrollH, scrollV))
if i'm not wrong, dis viewer member should actually be an empty image where da pixels from my composite image is transfered into dis viewer, right?

but, where would i put diz codes in? should i put it into a custom scrollbar lingo?
can u provide me with an example of an image scroller with slider bar?

gildan2020
0
 
LVL 20

Accepted Solution

by:
MediaMacros earned 125 total points
ID: 9859045
You have the base idea, yes. :)

This is getting a bit into custom code, but I can give you some resources.  For the basics on imaging lingo I have an article here...
http://www.macromedia.com/devnet/mx/director/articles/imaging_lingo.html

This will get you started in making the custom bitmap.  Yes it is ultimately a bitmap but comes from text sources at runtime so its easier to edit.

For scrolling you need to calculate a few key things...

1. The rect of the viewer image
2. THe rect of the larger image
3. The difference in the 2.  THis is the maxH and maxV scroll.  Never let the scroll go over these or below 0

Then scrolling is simply a percentage.  If you have a line 50 pixels wide and you are 30 pixels over on it then its .6 (or 60%) so if your maxScroll is 100 then 100 * .6 is 60, so the scroll value for the image is 60.

There are a lot of scroll behaviors at www.mediamacros.com  None specific to images but all easily adapated.
0
 

Author Comment

by:gildan2020
ID: 9864981
hmm...i'll probably need a lot of reading, thx 4 ur help


gildan2020
0
 
LVL 20

Expert Comment

by:MediaMacros
ID: 9866919
NP.  Ask if you get stuck in the process. :)
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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
Build and evolve an interactive experience 1 99
use of cookies and regulations 1 102
Problem to echo 6 115
Windows Tool to Build Android and iOS App 3 113
When deciding to adopt any help desk solutions many factors should be explored before taking decisions. This will change from business to another but in general there are some kind of rule of thumb. Here are some quick tips: Do we need only ticket…
This guide will walk you through the essential considerations and tech stack for building scalable websites. Know how to grow your business the smart way!
The purpose of this video is to demonstrate how to make a WordPress Site faster and smaller in size by cleaning up the database. This will be demonstrated using a Windows 8 PC. Plugin WP Optimize will be used. Go to your WordPress login page. T…
The purpose of this video is to demonstrate how to update a WordPress Site’s version. WordPress releases new versions of its software frequently and it is important to update frequently in order to keep your site secure, and to get new WordPress…

763 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