Question

scrolling pictures that you click and pop out at you...

Asked by: damn_computer

MM im sure you can tackle this one...

i want to make that same scroller from my previous question but i want to make it so that when i click on one of the images it will pop uot at me from where it currently is in the screen... perfect example is this site right here:

http://lambiance-design.com/ck/production/ck.html

you have to click the photos thing (good luck getting it with that annoying moving thing...lol)
then click "the daily life of the uyghur people"

i dont care about the scrolling depending on the mouse position for now... i just want to make it so taht i can have my same basic idea from before (the scrolling pictures http://www.del.by.cs.com/html/directorscroller.html)

but i want them to pop out in the same way that these do at that page, from where they are and they zoom in and center while the rest fades out... i can do the fading out by creating a black rectangle and messing with the opacity... but i dont know how to make them pop out from place and center in on the display

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2003-08-12 at 09:42:18ID20707407
Tags

scrolling

,

pictures

Topic

Adobe Director

Participating Experts
1
Points
115
Comments
45

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. Zoom | Scroll
    Hi... Could anyone show me how to zoom ->and<- scroll a bitmap within a CDialog? First off... I load a bitmap from file. I then draw it on the background of the dialog in the OnEraseBkgnd function.
  2. Zooming
    Are there any objects that allow zooming in on images? How would I write a routine to magnify the image (x2, x4, x8) based on user input, and resize the form accordingly?
  3. In Excel, with Mouse scroll, can't zoom > 100%.
    I use Excel 2000 with Windows 98SE. I use a Logitech Cordless Mouseman Wheel Mouse. Like in other applications, I can zoom in and out using the Ctrl key and the mouse scroll wheel. However, in Excel only, I am limited to zooming in to only 100% - can't zoom to greater than...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: MediaMacrosPosted on 2003-08-12 at 11:42:47ID: 9132410

Easiest way is on click get the current item like you are now.  Then using the scroll find hte left and right location of that file and use an invisible sprite to set a copy of the image on top of hte scroller in that location, and then make it visible and enlarge it.  I can think of some more sophisticated ways as well but this is your easiest bet I think with what you already have.  There are some enlarge on rollver type behaviors on my site (www.mediamacros.com) you can use for ideas as well.

 

by: damn_computerPosted on 2003-08-12 at 14:36:43ID: 9133826

alright so i guess i will be using how many pixels have gone by to determing the location of the image...
like we did before here using clickspot:

on mouseUP me
 clickSpot = (the mouseH) - sprite(spriteNum).left
 --now get the spot in teh scroll...
 actual = clickSpot - pScroll
 if actual < 0 then
    actual = pTiles * pTileRect.width + actual
 else if actual > pTiles * pTileRect.width then
   actual = actual - pTiles * pTileRect.width
 end if

so how do i adapt this to serve my purpose...and how do i get that image to align itself with the image in the scroller?

 

by: MediaMacrosPosted on 2003-08-13 at 06:42:04ID: 9138597

Well once you know the image we can find hte scoll location of it.

clickImage = (actual / (pTileRect.width)) + 1
scrollRect = pTileRect.offset((pTileRect.width * (clickImage - 1)) + pScroll)
sendAllSprites(#place, clickImage, scrollRect)
That gives you the rectangluar are of that image.  You still need to see if its beyond the left or right edge of the sprite and if so wrap it back but that will let you place it.  Then you cna have a single image on the screen witht he blend set to 0.  

on place me, whatImage, whatRect
  sprite(spriteNum).memeber = member(string(whatImage))
sprite(spriteNum).rect = whatRect
sprite(spriteNum).blend = 100
end

Look on my site for some behaviors to zoom in and out to take this to the next level and scale the newly placed image up, etc.

 

by: damn_computerPosted on 2003-08-13 at 09:30:28ID: 9139804

so did i want to place both of those scripts under the "on mouseUp me" command?

this is how i put it together in the last part of the script...

on mouseUP me
  clickSpot = (the mouseH) - sprite(spriteNum).left
  --now get the spot in teh scroll...
  actual = clickSpot - pScroll
  if actual < 0 then
    actual = pTiles * pTileRect.width + actual
  else if actual > pTiles * pTileRect.width then
    actual = actual - pTiles * pTileRect.width
  end if
 
  --then see which its inside
  clickimage = (actual / (pTileRect.width))+ 1
  go string(clickimage)
 
  scrollRect = pTileRect.offset((pTileRect.width * (clickImage - 1)) + pScroll)
sendAllSprites(#place, clickImage, scrollRect)

on place me, whatImage, whatRect
 sprite(spriteNum).memeber = member(string(whatImage))
sprite(spriteNum).rect = whatRect
sprite(spriteNum).blend = 100
end
 
end

when i try this tho... it says: "three parameters expected"  
and it has a problem with this part of it:

scrollRect = pTileRect.offset((pTileRect.width * (clickImage - 1)) + pScroll)

 

by: damn_computerPosted on 2003-08-13 at 09:42:51ID: 9139916

i havent been able to find any of the behaviors you told me to look up on your site... i searched for "zoom" and didnt find anything that related to it directly

 

by: MediaMacrosPosted on 2003-08-13 at 09:55:54ID: 9140026

Here are a few

http://www.mediamacros.com/item/item-966878309/
http://www.mediamacros.com/item/item-1006687252/ - imaging lingo to scale a bitmap member

Also look in the library palett. I think there is a zoom behavior in there as well.  Basically you are just chaning the rect of the sprite each frome to make it "grow"

 

by: damn_computerPosted on 2003-08-13 at 10:15:10ID: 9140171

yea i like th epallete one...its nice and simple and it gets the job done...

so again, where do i put those previous lines of code? sorry that i am such a beginner...hehe, but im deffinitly learning alot lately

 

by: MediaMacrosPosted on 2003-08-13 at 10:23:56ID: 9140230

on mouseUP me
 clickSpot = (the mouseH) - sprite(spriteNum).left
 --now get the spot in teh scroll...
 actual = clickSpot - pScroll
 if actual < 0 then
    actual = pTiles * pTileRect.width + actual
 else if actual > pTiles * pTileRect.width then
   actual = actual - pTiles * pTileRect.width
 end if
 
 --then see which its inside
 clickimage = (actual / (pTileRect.width))+ 1
 go string(clickimage)
 
 scrollRect = pTileRect.offset((pTileRect.width * (clickImage - 1)) + pScroll)
sendAllSprites(#place, clickImage, scrollRect)
end

on place me, whatImage, whatRect
sprite(spriteNum).memeber = member(string(whatImage))
sprite(spriteNum).rect = whatRect
sprite(spriteNum).blend = 100
end
 

 

by: damn_computerPosted on 2003-08-13 at 11:04:21ID: 9140546

ok, so i inserted that code into the view window...

so now that will define whatImage & whatRect, right?

now i am not quite sure what i am supposed to do with the actual image that is going to be displayed... i am gonna put the pallette zoom behavior on it... but i am not sure how i get it to originate from where the image in the scroller is... i dont know how we use the whatImage & the whatRect to do this

 

by: MediaMacrosPosted on 2003-08-14 at 06:33:26ID: 9146393

Well this gets a little more tricky as you are controling 2 sets of functionality together but again, lets take it one step at a time.  Lets get it placing and zooming, then we can look at making it hide again. :)

The on place me.... code goes ont on teh slider, but instead into the zoom behavior.  Also on the zoom we need to hide it off screen at first...

on hide me
  sprite(spriteNum).rect = sprite(spriteNum).rect.offset(-1000,-1000)
  sprite(spriteNum).blend = 0
end

And in the zoom behavior add this at the END of the begin sprite...

me.hide()

That shoudl hide it initially and then when you click it calls the place script that shoudl move it to the correct location on screen.

 

by: damn_computerPosted on 2003-08-14 at 09:38:48ID: 9148071

ok, so i am not sure where to put those scripts into... i put the "me.hide()" at the end of the beginesprite in the zoom behavior...

on beginSprite me
  pZoomed = resolve(pZoomed)
  pAuto = resolve(pAuto)
  mInitialize me
  me.hide()
end beginSprite

thats just gives me an error...

as for:

on hide me
 sprite(spriteNum).rect = sprite(spriteNum).rect.offset(-1000,-1000)
 sprite(spriteNum).blend = 0
end

i am not sure where to place it in the zoom behavior
everywhere i try it tells me "variable used b4 assigned a value"

 

by: MediaMacrosPosted on 2003-08-14 at 13:42:58ID: 9149927

Some programmer's do nto use spriteNum as it was intended.  Just add

property spriteNum

to the top of hte script with the other properties.  Then make sure the hide handler is not inside another handler but is inside the same behavior.

 

by: damn_computerPosted on 2003-08-14 at 14:10:58ID: 9150141

ok, so i replaced the beginsprite me part in the zoom behavior and i also put the

on hide me
sprite(spriteNum).rect = sprite(spriteNum).rect.offset(-1000,-1000)
sprite(spriteNum).blend = 0
end

in the zoom behavior right after the last property SpriteNum that i added to the list...

so now whenever i play it it goes fine...but when i click anywhere on the viewwindow it says:

error: 3 parameters expected
scrollRect = pTileRect.offset((pTileRect.width * (clickImage - 1)) + pScroll)

 

by: MediaMacrosPosted on 2003-08-14 at 14:32:05ID: 9150305

scrollRect = pTileRect.offset((pTileRect.width * (clickImage - 1)) + pScroll, 0)

 

by: damn_computerPosted on 2003-08-14 at 14:42:01ID: 9150372

ok, now it works...and i found another one of ur spelling mistakes that was holdling me back...lol

so now whenever click the first one... it goes to the top left of the screen and when i click the second one it goes to the middle of the screen... it is going to the markers that i have made in the score as expected :)

so we're makin progress here! hehe

 

by: damn_computerPosted on 2003-08-14 at 14:45:19ID: 9150395

errr... i would say to send it to you...but the file size is like 6mb... if u have the patience to download that.. i'll send it over like the other ones

 

by: MediaMacrosPosted on 2003-08-14 at 14:47:46ID: 9150415

Sure. I have broadband, but it will be tomorrow before I can look at it.

 

by: damn_computerPosted on 2003-08-14 at 14:54:18ID: 9150455

alright, i'll upload it 2nite and we'll take a look at it again 2m

 

by: damn_computerPosted on 2003-08-14 at 14:56:25ID: 9150467

 

by: MediaMacrosPosted on 2003-08-15 at 07:23:06ID: 9158850

Ok.  THis sohudl fix it.  First you want to make your large images the same as the small ones (IE the black border) so the proportions are hte same.  THen here are the 2 behaviors.  This goes on teh scroller....


------------------Start scroller
property spriteNum --the sprite
property pScroll --the currentScroll
property pWidth -- width of the "window"
property pTileRect -- rect of the tiles
property pTiles -- number of tiles
property pMember -- the current member
property pMaxScroll

on beginSprite me
  pTiles = 6
  pWidth = sprite(spriteNum).width
  pTileRect = member("pano-1").rect
  pScroll = 0
  pMaxScroll = pTiles * pTileRect.width - sprite(spriteNum).width
  pMember = sprite(spriteNum).member
  me.drawPano()
end

--now a handler to scroll it
--call this from your buttons with sendAllSprites()
on scrollIt me, vAmmount
  pScroll = pScroll + vAmmount
  me.drawPano()
end

--and then the draw handler
on drawPano me
  --if we are over 1 wrap in the scroll then wrap it back to one "wrap"
  if pScroll > pMaxScroll then
    pScroll = pScroll - (pTiles * pTileRect.width)
  end if
 
  --if its below 0 reset it back to a positive number based on wraps
  repeat while pScroll < -(pMaxScroll)
    pScroll = pScroll + (pTiles * pTileRect.width)
  end repeat
  --draw each of the tiles in
 
  repeat with x = 1 to pTiles
    --which member to copy...
    r = pTileRect.offset((pTileRect.width * (x-1)) + pScroll, 0)
    if r.left <  -(pMaxScroll) then
      r = r.offset(pTiles * pTileRect.width, 0)
    end if
   
    if r.left > pMaxScroll then
      r = r.offset(-(pTiles * pTileRect.width), 0)
    end if    
    if r.right < 0 or r.left > sprite(spriteNum).width then next repeat
    m = member("pano-" & x)
    pMember.image.copyPixels(m.image, r, m.rect)
  end repeat
 
on mouseUP me
  clickSpot = (the mouseH) - sprite(spriteNum).left
  --now get the spot in teh scroll...
  actual = clickSpot - pScroll
  if actual < 0 then
    actual = pTiles * pTileRect.width + actual
  else if actual > pTiles * pTileRect.width then
    actual = actual - pTiles * pTileRect.width
  end if
 
  --then see which its inside
  clickimage = (actual / (pTileRect.width))+ 1
 -- go string(clickimage)
 
  scrollRect = pTileRect.offset((pTileRect.width * (clickImage - 1)) + pScroll, 0).offset(sprite(spriteNum).left, sprite(spriteNum).top)
  sendAllSprites(#place, clickImage, scrollRect)
end

---------------end scroller



This goes in place of the current zoom on the zoom picture.  ALso place the zoom picture on teh same frame as the scroller for this to work....



-----------start zoom
property spriteNum
property pBaseRect
property pDestRect
property pActive
property pFrames
property pStep


on getPropertyDescriptionList me
  p = [:]
  p.addProp(#pFrames, [#format : #integer, #default : 10, #comment : "How Many Frames"])
  return p
end

on place me, clickImage, scrollRect
  put scrollRect
  pBaseRect = scrollRect
  m = member(string(clickImage))
  r = m.rect
  dw = (r.width - pBaseRect.width)/2
  dH = (r.height - pBaseRect.height)/2
  pDestRect = pBaseRect + rect(-dw, -dh, dw, dh)
  put pDestRect && pBaseRect
 
  pACtive = pFrames
  pStep = (pDestRect - pBaseRect) / float(pFrames)
  sprite(spriteNum).member = m
  sprite(spriteNum).rect = pBaseRect
end

on exitFrame me
  if pActive > 0 then
    sprite(spriteNum).rect = pDestRect - (pStep * pActive)
    pACtive = pACtive - 1
  end if
end

on hide me
  sprite(spriteNum).rect = rect(-10,-10,-10,-10)
end

on beginSprite me
  me.hide()
end

on mouseLeave me
  me.hide()
  end
--end zoom

 

by: damn_computerPosted on 2003-08-15 at 09:28:14ID: 9160584

ok, so i have the black window... i put the first script on that.
then i have the picture that i want to zoom... i dropped the second script on that.

i am confused by what you meant by making my large images the same as the small ones...u mean using the same ones that i use for the pano for the blown up picture?

and also, if u look at how i have it set up, the scroller is in all of the frams and the picture is within sum of those frames... do u mean to just make them both in one frame? im havin a lil trouble following

 

by: MediaMacrosPosted on 2003-08-15 at 09:35:46ID: 9160700

You need the large image present on the screen at all times (it will hide itself) so that the scroller cna send it commands.

What I mean by making them the same is that they need the same border.  Run it as you have it now and you will see the scaling is a bit strange because they are scaling from a set rectangle to all different sizes because the large versions don't ahve hte black border.

 

by: damn_computerPosted on 2003-08-15 at 09:42:14ID: 9160780

ah i get it now... so i made the image occupy all the frames that are in use...and when i click play it hides itself...but then when i click on a pic in the scroller it gives me this error:
cannot divide by 0

pStep = (pDestRect - pBaseRect) / float(pFrames)... i guess i would b adding a "1" somewhere in there?

i completely forgot about the black borders on the actual pictures...lol... so i'll just make the large images have the same proportion of a black border

 

by: MediaMacrosPosted on 2003-08-15 at 10:15:06ID: 9161192

Click the image that is on and go to the behavior inspector.  OPen the dialog box to set the properties for that sprite. ;)

 

by: damn_computerPosted on 2003-08-15 at 10:41:21ID: 9161368

i dont really get what you want me to do in the behavior inspector... are you talkin abuot the large image that gets hidden or the scroller view window?

 

by: MediaMacrosPosted on 2003-08-15 at 14:08:22ID: 9162817

If you click on any sprite then go to Window>Inspector>Behavior inspector it opens up a window that shows all the behaviors on the sprite.  Click the "gear" icon in there to open up the behavior properties for the code and this wil let you fill in values in the dialog that opens.

 

by: damn_computerPosted on 2003-08-15 at 15:27:00ID: 9163315

wow cool there it goes! hehe :)

i wasnt sure what to fill in under the properties so i jsut left it at its default of 10 frames.

and it does it for the first 5 images... i dont understand why it does this, not complainin at all! haha...but it doesnt do the last one....

 

by: damn_computerPosted on 2003-08-15 at 15:29:36ID: 9163329

hmm... and i figured out that it also doesnt work when i am scrolling using the left arrow... when i do... only the first 3 images work... strange

 

by: damn_computerPosted on 2003-08-15 at 15:35:05ID: 9163348

i also only had to place one of the large images on teh stage... hmm... is it part of the code to recognize what the other images are called in the cast? did u do that or is it just super-smart like that?

 

by: MediaMacrosPosted on 2003-08-18 at 08:48:08ID: 9174349

It does that. ;)  It takes what you click on and swaps that cast member in as needed.

I may need to recheck the code.  I wrote most of it here in the browser, so I need to verify it.  Let me know what is broken and I will test it.

 

by: damn_computerPosted on 2003-08-18 at 13:50:41ID: 9176520

http://www.del.by.cs.com/tests/WIP/works_in_progress-clubquarters-noresize2.zip

here, i posted it up again... that way you can take a look at it and see what it is im doing wrong...hehe

 

by: damn_computerPosted on 2003-08-19 at 12:46:55ID: 9183513

we're almost there! hehe dont give up on me now :)

we just need to get that working that whichever way u scroll it works and that when you click on it and it does the szoom thing... it comes into the center and the rest fades out

 

by: MediaMacrosPosted on 2003-08-20 at 07:27:45ID: 9188471

The file you sent appears to be scrolling fine here.  If you want to have it zoom from the center instead of zoom from the location of the image you click then just set a rect in the script on the "zoom" image instead of accepting hte paramter from the scroller.  IE...

on place me, clickImage, scrollRect
 pBaseRect = scrollRect

would be...

on place me, clickImage, scrollRect
 pBaseRect = rect(200,200,400,400) --put the rect here that you want it to zoom to for all images.

Just alter the rect above to the rect you want it to zoom to.

 

by: damn_computerPosted on 2003-08-20 at 12:18:32ID: 9190604

i cuold use that for a future project...
but what i meant is...that it starts at location and then it moves into the center of the movie as it zooms in... i want it to take center stage and i want it to originate from the current image

 

by: MediaMacrosPosted on 2003-08-20 at 12:30:19ID: 9190695

in the on place handler change this...

 pDestRect = pBaseRect + rect(-dw, -dh, dw, dh)


to

 pDestRect = pBaseRect + rect(200,200,400,400)

Just change that rect to the actual place you want it to open, or to center it..

change this...
 r = m.rect
 dw = (r.width - pBaseRect.width)/2
 dH = (r.height - pBaseRect.height)/2
 pDestRect = pBaseRect + rect(-dw, -dh, dw, dh)


to...

 r = m.rect
 dw = ((the stage).rect.width - r.width)/2
 dH = ((the stage).rect.width - r.height)/2
 pDestRect = r.offset(dw, dh)

 

by: damn_computerPosted on 2003-08-20 at 14:48:11ID: 9191580

nicely done! :)

this is gonna turn out great once i get the details down! :D

now i would like to make it so that it only goes away when you click somewhere (not when your mouse leaves the image)
so i will probably wnat to change this here:
on mouseLeave me
 me.hide()
 end

but i dont want it to conflict with the fact that when i click on an image it brings up the image i clicked on...
what i mean is:
when i already have one image centered and zoomed in and i click over another image... i dont want it to bring up the image i click on, but i want it to just return to the scroller.

 

by: damn_computerPosted on 2003-08-20 at 14:50:10ID: 9191589

hmm..noticed something strange...

when i begin by scrolling to the left... and i click on one of the pix that just appeared from teh left... it comes from the right side (instead of the locatoin the image is at) and then centers

 

by: damn_computerPosted on 2003-08-20 at 14:55:46ID: 9191620

cool, i am catchin onto this stuff... u had made a mistake on line: dH = ((the stage).rect.width - r.height)/2 and i realized it cuz it wasnt centering height-wise right... so i just went ahead and changed that "width" in tehre to "height" and it fixed it :)

 

by: MediaMacrosPosted on 2003-08-20 at 15:01:29ID: 9191653

Good job.  ;)  

For the hide, you can put a signal on the image and background like this...

on mouseUp me
sendAllSprites(#hide)
end

 

by: damn_computerPosted on 2003-08-20 at 15:21:46ID: 9191739

ok, strangeness revised:

after the 5th picture... they all come from the right side regardless of where the source picture is located

 

by: damn_computerPosted on 2003-08-20 at 15:23:18ID: 9191749

so by puting a signal on the image and background...

do u mean put it on the script that is on the scroller image?
and how do i put it on the background? not following u 100% there...hehe

 

by: damn_computerPosted on 2003-08-22 at 16:37:41ID: 9207299

i noticed somethingin the code...

it says if actual < 0 then
actual pTiles * pTileRect.width + actual

i figure when i am scrolling using the left arrow... it is turning into negative #s (<0)... so would that be why my images arent coming from the right spot when i scroll in that direction?
here is where that code came from:

on mouseUP me
 clickSpot = (the mouseH) - sprite(spriteNum).left
 --now get the spot in teh scroll...
 actual = clickSpot - pScroll
 if actual < 0 then
    actual = pTiles * pTileRect.width + actual
 else if actual > pTiles * pTileRect.width then
   actual = actual - pTiles * pTileRect.width
 end if
 
 --then see which its inside
 clickimage = (actual / (pTileRect.width))+ 1
-- go string(clickimage)
 
 scrollRect = pTileRect.offset((pTileRect.width * (clickImage - 1)) + pScroll, 0).offset(sprite(spriteNum).left, sprite(spriteNum).top)
 sendAllSprites(#place, clickImage, scrollRect)
end

 

by: damn_computerPosted on 2003-08-29 at 13:39:34ID: 9251153

i think that the problem has somethng to do with the size of the view window...
the window is about the size of 3 images... that would explain why only the first 3 images work and the rest dont.

i cant fiind anything in the code that i myself could change to fix that little glitch... any ideas MM?

 

by: MediaMacrosPosted on 2003-09-01 at 06:29:37ID: 9261520

Here is my current code and it does apper to be working as expected here...

property spriteNum --the sprite
property pScroll --the currentScroll
property pWidth -- width of the "window"
property pTileRect -- rect of the tiles
property pTiles -- number of tiles
property pMember -- the current member
property pMaxScroll

on beginSprite me
  pTiles = 6
  pWidth = sprite(spriteNum).width
  pTileRect = member("pano-1").rect
  pScroll = 0
  pMaxScroll = pTiles * pTileRect.width - sprite(spriteNum).width
  pMember = sprite(spriteNum).member
  me.drawPano()
end

--now a handler to scroll it
--call this from your buttons with sendAllSprites()
on scrollIt me, vAmmount
  pScroll = pScroll + vAmmount
  me.drawPano()
end

--and then the draw handler
on drawPano me
  --if we are over 1 wrap in the scroll then wrap it back to one "wrap"
  if pScroll > pMaxScroll then
    pScroll = pScroll - (pTiles * pTileRect.width)
  end if
 
  --if its below 0 reset it back to a positive number based on wraps
  repeat while pScroll < -(pMaxScroll)
    pScroll = pScroll + (pTiles * pTileRect.width)
  end repeat
  --draw each of the tiles in
 
  repeat with x = 1 to pTiles
    --which member to copy...
    r = pTileRect.offset((pTileRect.width * (x-1)) + pScroll, 0)
    if r.left <  -(pMaxScroll) then
      r = r.offset(pTiles * pTileRect.width, 0)
    end if
   
    if r.left > pMaxScroll then
      r = r.offset(-(pTiles * pTileRect.width), 0)
    end if    
    if r.right < 0 or r.left > sprite(spriteNum).width then next repeat
    m = member("pano-" & x)
    pMember.image.copyPixels(m.image, r, m.rect)
  end repeat
 
on mouseUP me
  clickSpot = (the mouseH) - sprite(spriteNum).left
  --now get the spot in teh scroll...
  actual = clickSpot - pScroll
  if actual < 0 then
    actual = pTiles * pTileRect.width + actual
  else if actual > pTiles * pTileRect.width then
    actual = actual - pTiles * pTileRect.width
  end if
 
  --then see which its inside
  clickimage = (actual / (pTileRect.width))+ 1
  -- go string(clickimage)
 
  scrollRect = pTileRect.offset((pTileRect.width * (clickImage - 1)) + pScroll, 0).offset(sprite(spriteNum).left, sprite(spriteNum).top)
  if scrollRect.left > pMaxScroll then
    scrollRect = scrollRect.offset(-(pTiles * pTileRect.width), 0)
    end if
    sendAllSprites(#place, clickImage, scrollRect)
end

 

by: damn_computerPosted on 2003-09-02 at 15:33:32ID: 9270701

hmmm... strange... the code looked pretty much the same but when i pasted urs in there it works perfectly... maybe i had sum little mistake i overlooked inside of mine

so now i want to chage one thing about it... i dont want that pops up to go away until i click sumwhere on the screen... i dont like the mouseout thing because it is hard to anticipate i would like it so that when i click on the screen then it will go away and return to the scroller... not sure if i am making much sense, lemme knw if im not...hehe

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...