A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: [CS3] Dynamically upload txt and jpg

  1. #1
    Member
    Join Date
    Apr 2008
    Location
    Athens, Greece
    Posts
    35

    [CS3] Dynamically upload txt and jpg

    Hi again. I need a way to dynamically upload txt into a movie clip. The loadVariables command seems to work, but when it comes to uploading the txt with a jpg or a bttn next to it in the same mov another command is needed or another way. Using xml maybe?

  2. #2
    Flactionscrish Baby Minion's Avatar
    Join Date
    Nov 2005
    Location
    Planet Earth
    Posts
    312
    That question is not well formed. Upload?

    Are you trying to use LoadVars to load a txt file into your flash app?
    ktu[k-two]
    he who hesitates is lost; so i guess i'll wander intently

    Are you sure this is real?
    Life is Love, Love is Blind, Blind we go through Life.
    Life isn't hard, dealing with your self is.

    The concept of life in a human brain is weakening day after day. Live every day like its your last. Take the chances, and opportunities, and never let authority push you around for fun.


  3. #3
    Member
    Join Date
    Apr 2008
    Location
    Athens, Greece
    Posts
    35
    Hi Baby Minion, thank you for your time and interest in my problem. I need to have a txt uploaded into a mov from a txt file. This is the first part. I need it to be scrolling so that it can hold as much txt as I like and if there is a possible way I'd like to have a bttn next to it that will upload dynamically a jpg or swf. For example, If there are 5 topics in the txt that needs to be uploaded, on top of each topic next to the txt i'd like to have a specific bttn, which means 5 bttns, one for each topic. If it's very extravagant to ask for something like this, just the scrolling txt would be helpfull enough. Thanks again, I'm really new in this whole as thing so it's REALLY difficult for me.

  4. #4
    Member
    Join Date
    Apr 2008
    Location
    Athens, Greece
    Posts
    35
    Hi Baby Minion, thank you for your time and interest in my problem. I need to have a txt uploaded into a mov from a txt file. This is the first part. I need it to be scrolling so that it can hold as much txt as I like and if there is a possible way I'd like to have a bttn next to it that will upload dynamically a jpg or swf. For example, If there are 5 topics in the txt that needs to be uploaded, on top of each topic next to the txt i'd like to have a specific bttn, which means 5 bttns, one for each topic. If it's very extravagant to ask for something like this, just the scrolling txt would be helpfull enough. Thanks again, I'm really new in this whole as thing so it's REALLY difficult for me.

  5. #5
    Flactionscrish Baby Minion's Avatar
    Join Date
    Nov 2005
    Location
    Planet Earth
    Posts
    312
    So you are talking about a ticker (like a stock market ticker on a news show) that scrolls across with topics. and at the end of each topic, a button is there to click, so you can view more information about that topic?
    ktu[k-two]
    he who hesitates is lost; so i guess i'll wander intently

    Are you sure this is real?
    Life is Love, Love is Blind, Blind we go through Life.
    Life isn't hard, dealing with your self is.

    The concept of life in a human brain is weakening day after day. Live every day like its your last. Take the chances, and opportunities, and never let authority push you around for fun.


  6. #6
    Member
    Join Date
    Apr 2008
    Location
    Athens, Greece
    Posts
    35
    Yes, something like that, but the scrolling must be vertical and the txt and bttns must load dynamically. I've managed to load dynamically the txt from a txt file into a dynamic text field and used the scrolling component of flash to make it scroll, but I need another type of scroller, one which will include the bttns into it in a certain position next to the txt.

    I've created two dynamic txt fields to hold the txt and one to hold the image and used this type of code:

    myData = new LoadVars()
    myData.load("my.txt")
    myData.onLoad = function(succes){
    if(succes){
    Title_txt.htmlText = "<b>"+this.Title+"</b>"
    Comments_txt.text = this.Comments
    holder_mc.loadMovie(this.Image)
    } else trace("Error loading data")
    }
    BUT in this way the image loads only in the position where the mov that holds it is set on my scene. I need it to load always on the beginning of the txt no matter how many txts I load. If for example there are three txts that need to be loaded and three bttns for each txt I need them to appear always on the beginning of the equivalent txt.
    Once again I want to thank you for your responce and your time, I relly appreciate it.

  7. #7
    Flactionscrish Baby Minion's Avatar
    Join Date
    Nov 2005
    Location
    Planet Earth
    Posts
    312
    Here's an awesome trick that should help you.

    Inside of html enabled textFields, you can use an <img> tag to place a mc inside of the textField.

    example:
    tf:TextField;
    tf.html = true;
    tf.htmlText = "<img src='button' id='topic1_btn'>: " + topicText;
    The src is the linkage ID in the library and the id allows you to access it later, so you can add eventlisteners to it or modify it later for any reason.
    Look at the Help panel in flash about the <img> tag. It'll help you understand everything else you can do with it.

    This way, the button is part of the text field and you should be good to go.
    ktu[k-two]
    he who hesitates is lost; so i guess i'll wander intently

    Are you sure this is real?
    Life is Love, Love is Blind, Blind we go through Life.
    Life isn't hard, dealing with your self is.

    The concept of life in a human brain is weakening day after day. Live every day like its your last. Take the chances, and opportunities, and never let authority push you around for fun.


  8. #8
    Member
    Join Date
    Apr 2008
    Location
    Athens, Greece
    Posts
    35
    Thank you so much, you've been really helpfull. I'll try to figure it out and make it work to my needs, you see even though I'm greek as is a bit greek to me. Thanks again..

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