POLALA.COM
welcome to my space
X
Web Design | Video Games | RVs | Religion | Management | Supplements and Vitamins | Software | Basketball | Related articles
Search:  
Welcome to:polala.com
NAVIGATION: Home >>
htmlText preloader ?!?
Published by: wktd 2010-03-19
  • Hello !:)

    I try to build a simple news reader which can display HTML text contained in XML file.
    I don't have any problem to preload XML file but I noticed that images contained in the HTML text aren't loaded in the first frame... So, as I don't know how many images have to be loaded, I don't know when I can get the final height of my textField to build the scroller...(which is the central point of my problem!)
    Peter Ent: Scrolling Text Component::
    Peter: You could modify the code to use the htmlText property and . ()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\preloaders\Preloader.as:398]
    http://weblogs.macromedia.com/pent/archives/2007/12/scrolling_text.html
    HOME

    Does someone have an idea ?
    Is it possible to preload the entire HTML text (I mean text and tags like ) before placing it in the textField ?
    Or is it possible to add a kind of loader to this HTML text which will indicate when the text is fully loaded ?

    Thanks a lot.


  • For those who can be interested :

    var totBytes:Number = 0;
    //put images in an Array
    var myImg:Array = new Array();
    for(var mc in myTextField){
    if(typeof(myTextField[mc]) == "movieclip"){
    myImg.push(myTextField[mc]);
    }
    Flash 8 ActionScript 2.0 Video Training Course | KeyStone Learning ::
    9.2 Project – Create a Preloader Bar Clip (Flash MX Style) Without 18.1 Dynamic HTML Text with LoadVars OnLoad( ); 18.2 Dynamic HTML Text with
    http://www.keystonelearning.com/courses/flash_8_actionscript_2_training_course/
    HOME
    FlashComponents: Circular Glow Preloader, dropMenu, XML Driven ::
    Circular preloader animation with glow effect. The dropMenu component provides an easy way t. Simple code No instance of btn MovieClip.
    http://www.softplatz.com/Info/FlashComponents.html
    HOME
    }

    //images preload
    this.onEnterFrame = function(){
    var bl:Number = 0;
    var tb:Number = 0;
    for(var img in myImg){
    bl += myImg[img].getBytesLoaded();
    tb += myImg[img].getBytesTotal();
    }

    if(bl/tb >= 1 && !isNaN(bl/tb)){
    delete this.onEnterFrame;
    makeScroll(myTextField);
    }
    }

    This work fine to preload images which are in html textField rendered from XML file... in order to build a smooth scrollable html textField for example...
    Thanks MureJIb;)


  • When Image is included into html-textField it is "rendered" as usual MovieClip.
    YOu can even include mc from the library using IMG tag.
    So you can "scan" textfield for MovieClips.

    for (var mc in test_txt) {
    if (typeof(test_txt[mc]) == "movieclip") {
    trace ("found IMG: "+test_txt[mc]);
    // if no ID was set - MC will be called instanceN
    }
    }

    And when typeof(test_txt[mc]) is true - you can add test_txt[mc] to some Array - and then manipulate this mc as other MovieClips


  • thanks for your quick answer !
    I try this now...


  • Great !!!
    I didn't know that.
    Thanks, this will help me a lot.


  • nicolb, glad to see it helped ))
    Funny, but today morning I understood that I needed this too )))
    Right now I was about to design some code for preloading img-s )))
    And here it is )) ready for use )


  • This work fine, but as I don't know how many images there are in my HTML text it's a little difficult to use images ID. I think a workaround is possible using the for() or while() statement and IDs like "img1,img2...", and testing if the image exists or not.
    But do you know if it's possible to obtain the images collection from the HTML text using tags and not IDs ?
    Thanks.


  • For this test you will need test.jpg in the same directory and two textFields on the stage - 'test_txt' with html render ON and prel_txt - to indicate preloader.

    var str:String="

    Testing the image preloader

    "
    test_txt.htmlText = str;
    onEnterFrame = function ():Void {

    var proc = test_txt.img.getBytesLoaded()/test_txt.img.getBytesTotal()*100;
    prel_txt.text = Math.round(proc);
    }





    The main part of the solution is giving an ID attribute in the IMG tag





  • Where's The Advantage In Windows Genuine Advantage?
    Stocks Bounce After S&P Joins Bear Market
    You are looking at:polala.com's htmlText preloader ?!?, click polala.com to home
    #If you have any other info about this subject , Please add it free.#
    Your name:
    E-mail:
    Telphone:

    Your comments:


    If you have any other info about htmlText preloader ?!? , Please add it free.
  • nicknames for autumn snow
  • lots of names mix and match please
  • what do you think of the name montgomery for a baby boy
  • names for characters in a story about a victorian kitchen maid can you give me an opening sentence
  • are there baby name cute
  • is the name madison a pretty name for a girl
  • beautiful unique feminine middle names
  • what is your list of top 10 girls names
  • can i get some suggestions of baby names
  • cute middle names for ella
  • last baby name question i promise do you like for my twins hazel sophia dayna liliana
  • my name is penelope
  • middle names for violet
  • fun question how should i spell this nickname

  • my cat had kittens now i need names
  • what do you think of the name brigid pronounced just like it looks brig ed
  • pick a name choice please
  • what should i call my baby
  • im having a boy soon and i need help choosing a name
  • do you like these names first and middle
  • what name for a girl is best
  • what do you think of the boy 039 s name mikhail
  • what are pretty middle names that sound good with the first name madison for a girl
  • top ten names can you please mix and match
  • what is your name and why were you named that do you like your name
  • what do you think of the name lilieanna lily anna
  • 8 months pregnant with twins need help with names
  •  Homepage | Add to favorites | Contact us | Exchange links | LOGIN | Site map | 
    Copyright© 2008 polala.com        Site made:CFZ