Solved

scroll image & text within a small boundary

Posted on 2003-11-30
7
7,617 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
[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
  • 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
Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

 

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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

This article provides a case study on how our local youth baseball league deployed a new website, including the platform selection, implementation and benefits to the league.
Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our system…
The purpose of this video is to demonstrate how to add AdSense Ads to a WordPress Website, and how to set up WordPress to automatically place Ads in Sidebars. This will be demonstrated using a Windows 8 PC. Log into your AdSense account. : Cli…
The purpose of this video is to demonstrate how to integrate Mailchimp with WordPress, by placing a Mailchimp signup form on a WordPress Page or Post. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mailchi…

705 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