A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: [F8] Dynamic Text Field Image UIScrollBar Questions

  1. #1
    Watch Your Head. GooseBump's Avatar
    Join Date
    Apr 2003
    Location
    The Resturant at the end of the Universe
    Posts
    431

    [F8] Dynamic Text Field Image UIScrollBar Questions

    Overview:
    I'm trying to import and image into a dynamic text field via a loaded text file and then scroll the image using the UIScrollBar component.

    Movie layout:
    2 frames, on the second frame I have the dynamic text field called "images_txt", set to scrollable and the UIScrollBar component next to it with it's prameter set to the name of the dynamic text field.

    I also have movieclip that checks and rechecks to see if the variable txt file is loaded (cause it's a big image) before loading it into the dynamic text field. It has 2 frames with code on the second frame.

    My text file:
    Code:
    vartext1=<img src="images/1.jpg">
    My first frame code:
    Code:
    newText = new LoadVars();
    newText.load("image.txt");
    Second frame code in my checker movieclip.
    Code:
    _root.newText.onLoad = function(success:Boolean) {
    	if (success) {
    		_root.resume.htmlText = _root.newText.vartext1;
    		trace("success!");
    		this.gotoAndStop(1);
    	} else {
    		this.gotoAndPlay(1);
    	}
    };
    What's happening:
    70% of the time nothing happens, nothing shows up in the text file, I do not get any output. The UIscrollbar component is visable and has sized it's self to the hieght of the dynamic text field but does nothing. I don't know why this is.

    30% of the time the image "images/1.jpg" is loaded into the dynamic text field and I get "success!" in the output. However the UIScrollBar does not have it's up and down arrows despite the fact that half the image is below the visable area of the text field.

    Bottum line:
    I need to bring in an image and have it scroll with the UIScrollBar component so it will match the rest of the project which uses the UIScrollBar component all over the place.

    Please Help!

  2. #2
    Watch Your Head. GooseBump's Avatar
    Join Date
    Apr 2003
    Location
    The Resturant at the end of the Universe
    Posts
    431
    I solved the first issue of the image sometimes not loading in... however the UIScrollBar component still fails to function.

    Any thoughts?

  3. #3
    Get Squared Away.
    Join Date
    Feb 2000
    Location
    Allentown, PA
    Posts
    543
    Maybe the scrollBar code is getting called before the image is loaded in. You should be able to fix this by setting the UIScrollbar to the text field with AS using something like this in your load function:

    Code:
    UIScrollbar.setScrollTarget(images_txt);
    Give that a shot...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center