Solved

scroll image & text within a small boundary

Posted on 2003-11-30
7
7,600 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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Set up Wildfly 10 8 319
Timer 6 79
LMS Tracking Survey Result 1 43
Problem to get function 52 83
When setting up new project requests for our site, one of the most powerful tools our team has available to use is Axure (http://www.axure.com/). It’s a tool for creating software and web prototypes that can function and interact as if it were the a…
Objective of This Article In 1990’s, when I was a budding software professional, I had a lot of confusion about which stream or technology, I had to choose to build my career. In those days, I had lot of confusion like whether to choose System so…
The purpose of this video is to demonstrate how to automatically show related posts at the bottom of a blog post in WordPress. This will be demonstrated using a Windows 8 PC. Plugin “Yet Another Related Posts Plugin” will be used. Go to your…
The purpose of this video is to demonstrate how to Import and export files in WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Click on Too…

708 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now