A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: Dynamic Flash(need a true pro here)

  1. #1
    Member
    Join Date
    Dec 2002
    Posts
    76

    Dynamic Flash(need a true pro here)

    I know how to load a varible that is declared and given a value in the source code of my web page where the .swf is embeded which looks like this:



    Code:
    PARAM NAME=movie VALUE="toggle.swf?url=test.html"
    
    //where 'url' is the varible, and the action script looks like this
    
    
    toggle.onRelease=function(){
    getUrl(url,_self);
    }


    But I've never figure how to do something similar with the .jpg's that I want to input for the .swf. Basically make them dynamic from the a webpage instead of having to change the .sfw itself. I use flash navigation bars and the whole thing is dynamic. The source looks like this.


    Code:
    PARAM NAME=movie VALUE="thorn.swf?tarframe=_self&exbackground=999999
    
    &makenavfield0=Order&makenavurl0=order.html
    
    &makenavfield1=Products&makenavurl1=products.html
    .
    .
    .
    &makenavfield6=Contact Us&makenavurl6=contact.html"




    Code:
    EMBED src="thorn.swf?tarframe=_self&exbackground=999999
    
    &makenavfield0=Order&makenavurl0=order.html
    
    &makenavfield1=Products&makenavurl1=products.html
    .
    .
    .
    &makenavfield6=Contact Us&makenavurl6=contact.html" 
    
    loop=false menu=false quality=high scale=noborder salign=LT  wmode=transparent bgcolor=#000000  WIDTH=155 HEIGHT=210
     TYPE="application/x-shockwave-flash"
     PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?
     P1_Prod_Version=ShockwaveFlash">
    All I know is for each bar I want to add I just put "&makenavfield" and "&makenavurl" in both places in the source code with the next number on the end, and assign each appropriate value and I get new bar labled with what was assigned to the field, and its linked to what was assigned to the url.

    What I don't know is how to write action script to accept varibles like that so if I want more toggle screens on my page with different images, and linked to different pages I don't have to upload and embed several different .swf files for each one.

    Can you help me with that? I'm guessing it's not as simple as giving getUrl() a varible and declaring that varible with a value in the source code of my page, but I'd still like to learn how anyway.

  2. #2
    Member
    Join Date
    Dec 2002
    Posts
    76
    .

  3. #3
    Danny Gomez Creations ® cosmiceye's Avatar
    Join Date
    Mar 2002
    Location
    under a palmtree in Jamaica waiting for psytopia 2005 to begin
    Posts
    982
    it would be much easier for you to load the variables from an external file at runtime. textfile or xml. I preffer xml, couse then you dont need to specify how many variables to collect from within flash.
    ..:: P S Y T O P I A 2 0 0 5 :::..
    . . . view the psytopia reels _____RIVEND REEL | GOMEZ REEL_____ . . . . . . . . . . .

  4. #4
    Danny Gomez Creations ® cosmiceye's Avatar
    Join Date
    Mar 2002
    Location
    under a palmtree in Jamaica waiting for psytopia 2005 to begin
    Posts
    982
    prommisse me to go and read this and go throu the sourcefile
    http://www.macromedia.com/support/fl...slideshow_xml/
    ..:: P S Y T O P I A 2 0 0 5 :::..
    . . . view the psytopia reels _____RIVEND REEL | GOMEZ REEL_____ . . . . . . . . . . .

  5. #5
    Member
    Join Date
    Dec 2002
    Posts
    76
    Yeah, I don't know how to do any of that. If I had the .fla for that nav bar, then I could probably figure out how it was done. I don't know how to anything with xml, I can barely do anything with actionscript. Can you offer any more help on how to do that exactly?

  6. #6
    Danny Gomez Creations ® cosmiceye's Avatar
    Join Date
    Mar 2002
    Location
    under a palmtree in Jamaica waiting for psytopia 2005 to begin
    Posts
    982
    1. klick the link, and download
    2. zip the files up
    3. go thru the sourcecodes
    4. dont worry be happy, drink coffee

    http://download.macromedia.com/pub/f...deshow_xml.zip
    ..:: P S Y T O P I A 2 0 0 5 :::..
    . . . view the psytopia reels _____RIVEND REEL | GOMEZ REEL_____ . . . . . . . . . . .

  7. #7
    Member
    Join Date
    Dec 2002
    Posts
    76
    Alright, I didn't mean I didn't know how to download source code and stare at it, and trial and error my own attempts to death, I just don't know anything about XML.
    I was confused at first how this would work, but after a quick glance at the .fla I see how it is setup to accept the varibles dynamically, and I would only have to edit the xml file, and not the .fla and publish a new .swf

    Thank-you for your help, the closest I've gotten to an answer, I'm just not looking forword to many more long nights(lots of coffee) trying to figure this out.

    Any good tutorials to ease the understanding of XML/Actionscript programming?

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