Not signed in (Sign In)

Vanilla 1.0.3 is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthormattd
    • CommentTimeSep 13th 2007
     
    Hey everyone - thanks for the great tools. They have helped immensely, but I'm driving myself nuts trying to do something that *should* be so simple. Here we go - I have one main.swf file that contains a child (container) clip called "videoTarget". A second .swf file named "video_default.swf" loads upon the main movie loading.

    Ok, with that out of the way ... I am passing variables through links on a page that contains main.swf -- the links pass variables just fine to main.swf but for the life of me I can't get any variables to pass through to the container clip ie. "videoTarget"

    I assume it is because the second clip isn't defined in the javascript as main.swf is:

    ---------------------------------

    <script type="text/javascript">
    var so = new SWFObject("main.swf", "videogallery", "604", "380", "8", "#FFFFFF");
    so.addParam("quality", "high");
    so.write("flashcontent");
    </script>

    ----------------------

    Do I need to define "video_default.swf" in order to pass variables to it within the parent .swf? If so, could someone please help? I Would greatly appreciate it!!

    Matt
    • CommentAuthormattd
    • CommentTimeSep 13th 2007
     
    Passing * Variables * to child items -- oops ;)
    • CommentAuthormattd
    • CommentTimeSep 13th 2007
     
    one other important thing --- I am using the following to pass variables to flash:

    <script language = "JavaScript"><!--
    function PassFlash1(){
    window.document.videogallery.SetVariable("title_txt", "title here");
    }
    //-->
    </script>

    and I'm linking to that function with the following:

    <a href="#" onClick="PassFlash1()">click the link</a>

    Once resolved, could someone please let me know how I should pass variables AND show an example of a link to pass them on?

    Thanks - I know how ridiculously simple this sounds, but it will help me a great deal
    • CommentAuthorAran
    • CommentTimeSep 13th 2007
     
    Matt.

    A few things.

    1. You are using a very outdated way of passing info into flash. You should look at external interface since you are targetting flash 8. See my sticky post a t the top of the forum, which unfortunately no one seems to read even when they are wanting to do js <> flash communication :(
    http://blog.deconcept.com/swfobject/forum/discussion/499/flash-to-browser-communication-with-swfobject/#Item_0

    2. You need to properly scope the variables to target your child movieclip. See the recent question/answer here:
    http://blog.deconcept.com/swfobject/forum/discussion/699/addvariable-when-dynamic-text-box-is-inside-a-movie-clip/#Item_0

    BTW - If people could do a quick search BEFORE posting questions it would be really good to the few helpful (but very professionally busy) volunteers which moderate the forums, as most of the time the questions have been asked/answered before :)

    Cheers,
    Aran
    • CommentAuthormattd
    • CommentTimeSep 14th 2007
     
    Thanks Aran. I actually did come across the scoping answer/post and figured that is where the problem stems. I guess lack of sleep blinded me to a few fundamental aspects I need to pay more attention to. Once back at work today I will follow both links you have provided here and hopefully resolve the issues I'm having.

    I truly appreciate your time and response. I will make sure to post my resolution, however simple it may seem, in hopes of helping some poor soul out there ;)
    • CommentAuthorAran
    • CommentTimeSep 14th 2007
     
    @mattd

    Cool. I know all about the lack of sleep, and perhaps that was unfairly reflected in my reply to you. We try to be a friendly/helpful as possible around here, but as you can appreciate, we get a lot of repeat requests. I hope your resolution comes quickly.

    Cheers,
    Aran
    • CommentAuthormattd
    • CommentTimeSep 15th 2007
     

    ;)
    • CommentAuthormattd
    • CommentTimeSep 15th 2007
     
    <img src"http://mattworks.com/pics/escortB17.jpg"><br /> ;)
    • CommentAuthormattd
    • CommentTimeSep 15th 2007
     
    the problem happened to be due to the video component I was calling, not the scoping itself. Essentially I was passing a variable to the video player, but the player wasn't told what to do with it.

    Through javascript I set a new variable to instruct the player (ns stream) to pause and then resume playing with the new .flv URL. Worked out great (after hours of banging my head into the wall)....and though this bit of code may work, please correct any mistake you may notice ...

    this.onEnterFrame = function() {
    if(reload_swf == "RRR") {
    videoTarget.flvplayer.video_url = video_url;
    videoTarget.flvplayer.ns.pause(video_url);
    reload_swf="XXX";
    videoTarget.flvplayer.ns.play(video_url);
    stop();
    }
    • CommentAuthorAran
    • CommentTimeSep 16th 2007
     
    You shouldn't need an onEnterFrame function if you are using external interface. With external interface you can call an internal flash function directly from javascript and pass it parameters; something like:

    (from your html page)

    flashMovie = document.getElementById("my_flash_movie");
    flashMovie .playVideo("http://some.com/some.flv");

    // my_flash_movie is the "id" of your swfobject movie
    //
    // the playVideo function can do anything inside your flash movie such as play/pause the netstream etc


    Anyhow, if your code is working for you and you are happy, then cool. It's just that since you never destroy your onEnterframe, it is constantly sucking CPU cycles.
    • CommentAuthorzhangsisi
    • CommentTimeSep 29th 2007
     
    find love sex www.NewMeetings.info/en/lang101752about_sisi11
    • CommentAuthorphilip
    • CommentTimeSep 29th 2007
     
    that zhangsisi post is SPAM! don't use the URL!
    • CommentAuthormattd
    • CommentTimeSep 29th 2007
     
    that's spam? looks like porn to me?!!@@ YES!