View Full Version : [CS3] getting a textfield to scroll when only comprised of images
Gar_Fonz
July 10th, 2008, 11:03 PM
I thought that I'd just do a quick post while I'm looking around for some info, but here's my question. I'm going to populate a textfield created with actionscript completly with .png images. The problem is that the scrollBar/textField doesn't seem to register that the image is larger than the viewable area, and after a scrollBar.update call, the scrollbar appears as it would if the textfield was populated text that is contained with the viewable area. in other words, you can't scroll and look at the entire image. Does anyone know of a workaround? I know that I have the scrollbar set up properly because I was previously loading a lot of text into the textfield and it was scrolling properly. I changed to an image without changing any of the code that would affect the behavior of the scrollbar.
saxx
July 10th, 2008, 11:16 PM
Did you design your own? because theres sevral here on kirupa that will do what you want
Gar_Fonz
July 10th, 2008, 11:19 PM
i was just using the default component, and was going to change the skins. You mean in the tutorials there's a selection of scrollbar tutorials instruction on this exact issue? cool, I was searching the help docs for info on why the scrollbar.update wasn't working. thanks for the pointer saxx!
Gar_Fonz
July 10th, 2008, 11:24 PM
I was also thinking of changing the textfield over to a sprite with a mask so that I could just move the .y position of the container sprite to create a scrolling effect.
Gar_Fonz
July 10th, 2008, 11:38 PM
This question is sort of morphing for me, but Any feedback could be interesting and appreciated. I was wondering if anyone new if there's a way to link the scrollbar position to the y property of a sprite? Unless I'm mistaken, I didn't see anything in the help docs. The property I need is the total size of the image. It seems like there is some calculations that are going on in the background of scrollBar.update that they didn't give the developer the ability to adjust and control. But again, I haven't experimented with it yet, as I've only read the docs, so perhaps that is my undoing.
saxx
July 10th, 2008, 11:38 PM
let me see if i can find the scrollbar i'm using at the moment. I don't remember where i got it exactly but here it is
edit
I don't have a very good understanding of sprites :D
I'm not sure about your other question, could you explain a bit more?
Gar_Fonz
July 11th, 2008, 12:03 AM
Thanks saxx for your file. It works and is helpful, but my other questions are still unanswered:red:
Gar_Fonz
July 11th, 2008, 12:31 AM
I found out that there is a scrollevent class that allows you to access the events of the scrollbar. That's what I needed. thanks for your help saxx!! apreciate it greatly!
amarghosh
July 11th, 2008, 06:21 AM
getImageReference (http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/text/TextField.html#getImageReference()) method of TextField class will give u a reference to the image. u can use it to calculate the height/scroll etc;
Gar_Fonz
July 12th, 2008, 04:36 PM
Thanks for your help amarghosh! I had not found that method yet. which reminds me, I need to look more carefully at the docs.
I appreciate because of your help!
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.