A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: Flashvars problems

  1. #1
    Senior Member
    Join Date
    May 2004
    Location
    UK
    Posts
    200

    Flashvars problems

    trying to use flashvars to trigger a certain part of an animation depending on the page, not only is it not working but its also preventing a series of mc buttons from working.

    the script to read the vars is:

    code:

    if (page == "home") {
    _root.cabinet_mc.gotoAndPlay("draw1_open");
    }
    if (page == "reg") {
    _root.cabinet_mc.gotoAndPlay("draw2_open");
    }
    if (page == "demo") {
    _root.cabinet_mc.gotoAndPlay("draw3_open");
    } else {
    _root.cabinet_mc.gotoAndPlay("draw4_open");
    }



    and the vars set in the html like this(snippet):

    PHP Code:
     <PARAM NAME=FlashVars VALUE="page=home">
                      <
    embed src="flash/ecabs.swf" FlashVars="page=home" 
    Thanks.

  2. #2
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397

  3. #3
    Senior Member
    Join Date
    May 2004
    Location
    UK
    Posts
    200
    all that has been covered, i do not even seem to be receiving the vars at the moment though. Was there something you were pointing me to in particular?

    BTW i'm using Firefox on XP but its not even working on IE.

  4. #4
    Senior Member
    Join Date
    May 2004
    Location
    UK
    Posts
    200
    i've tried changing it to :

    code:

    if (_root.page == "home") {
    _root.cabinet_mc.gotoAndPlay("draw1_open");
    }
    if (_root.page == "reg") {
    _root.cabinet_mc.gotoAndPlay("draw2_open");
    }
    if (_root.page == "demo") {
    _root.cabinet_mc.gotoAndPlay("draw3_open");
    } else {
    _root.cabinet_mc.gotoAndPlay("draw4_open");
    }



    but still with no joy, like i said before this script is actually preventing a number of mc's that act as buttons from working aswell. As soon as i remove the script the mc's work fine??

    FYI i'm on Flash MX, XPsp2, Firefox.

  5. #5
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    FYI, I don't use Firefox, and I'm not on XP...

    If you attach your .fla(s) and .html(s), I could have a look...

  6. #6
    Registered User
    Join Date
    Feb 2001
    Posts
    13,041
    Hi,

    you cannot go to a frame before it is actually loaded.
    The behaviour depends on loading speed, browser type, ....

    Musicman

  7. #7
    Senior Member
    Join Date
    May 2004
    Location
    UK
    Posts
    200
    this is in a second scene which contains a preloader so it should be loaded by this point anyway. file is a bit too big to attach, basic makeup is this:

    preloader in a scene.
    second scene contains an mc in the root called cabinet_mc inside which i use frame labels to navigate around. got some as on frame 1 like this:

    code:

    draw1open_btn.onPress = function(){
    _root.cabinet_mc.gotoAndPlay("draw1_open");
    }
    draw2open_btn.onPress = function(){
    _root.cabinet_mc.gotoAndPlay("draw2_open");
    }
    draw3open_btn.onPress = function(){
    _root.cabinet_mc.gotoAndPlay("draw3_open");
    }
    draw4open_btn.onPress = function(){
    _root.cabinet_mc.gotoAndPlay("draw4_open");
    }




    This also stops working when i try to use the flashvars code, i know the var is coming over as i'm able to echo it in a dynamic text area, it must be in my implementation, am i putting the flashvars code above (the if statements)in the wrong place?

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