A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Dynamic content in a flash movie?

  1. #1
    Junior Member
    Join Date
    Jun 2002

    I'll get right to the problem; What I want is to create a flash whose content is based on variable inputs from a database.

    What I have is a flash containing some text fields. The amount of text fields and their content is controlled by the in-parameters. For example, through a querystring in the flash URL I want to pass three textfield names, where the flash picks them up and "creates" the textfields. Is that possible? My intention is not only to do this for text field but with different elements too, but as I look at flash now, all I can see is that "dynamic" flash is to alter label content and such, but not create new on the fly. Is there a way to create template elements within a flash wich can be created and filled with content on demand?

    I hope you can understand my question and what I want to do, and hope for many answers! :-)

    david garcia

  2. #2
    Senior Member
    Join Date
    Nov 2000
    thats what flash is all about. say for example you have a list of messages from different ppl. create a single 'message box' movieclip that gets its information from a parent clip or retrieves its own data upon creation. you duplicate out that message box movie clip as many times as you need to display information. if you use the parent method, the ../ movieclip (or timeline) will have to send the data to the newly generated instance, for the self defining one, you can have it grab the data it requires interally, either by accessing the parent movie clip or some other level that you define in the parent. Although someone can give you specifics on doing this, the concept is always going to be the same. either your parent feeds the data or your children get it themselves.

  3. #3

    Flash MX has a "createTextField()" method that could do exactly what you're describing. The general form of what you're looking for would be:
    for (i=0; i<number_of_text_fields; i++) {
        _root.createTextField("text"+i,i, xLocation, yLocation ,width,height);
        eval ("_root.text"+i).text = myTextFromDatabase;
    and so on...

  4. #4
    Junior Member
    Join Date
    Jun 2002
    Ok guys, thanks for the info! I've started to look into it and it seems to fix what I'm after.

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