views:

23

answers:

1

Code inside Actionscript:

var methodName4:String = "startupload";
var instance4:Object = null;
var method4:Function = startupload;
var wasSuccessful4:Boolean = ExternalInterface.addCallback(methodName4, instance4, method4);
function startupload(currently_uploading_id) {

    /* If there is still more photos to upload, then proceed to next one */
    if((max_photo_number - session_photos))
    {
        uploadthis(selected_photos,currently_uploading_id);
    }
}

Html:

<div id="e_upload" class="hidden">
    <div id="upload_container">

    </div>
</div>

Javascript: when dom is loaded:

var cached_flash = $('#e_upload').html();
$('#e_upload').html('');

When generating html via javascript:
$(cached_flash).appendTo(full_ad.find('#e_upload_wrapper')).show();

That's it. When i'm trying to upload somethin, startupload function inside flash is not working anymore.

Calling Actionscript this way:

/* Sending back to Flash */
function thisMovie(movieName) {

    if (window.document[movieName]) {
        return window.document[movieName];
    }
    if (navigator.appName.indexOf("Microsoft Internet") == -1) {
        if (document.embeds && document.embeds[movieName])
            return document.embeds[movieName];
    }
    else // if (navigator.appName.indexOf("Microsoft Internet")!=-1)
    {
        return document.getElementById(movieName);
    }

}

thisMovie('fileref').startupload(currently_uploading_array_slot);

Actionscript is calling javascript functions from inside just fine, but javascript is not.

What is the problem? How to rebind startupload function?

A: 

you accessing document body, but your swf is deeper, so access it directly:

so not document.getElementById(movieName) but document.getElementById(e_upload).getElementById(movieName)

Eugene
Interesting, i'll try it. But i don't think the problem is in this. I'll check and post here if it will help.
Beck
It's some kind of bug inside plugin_container.exe or inside Firefox or even maybe because i'm using old flash and compile into 8.0. Whatever it was, i have positioned flash absolutely on the page without moving it inside dom. that solved my problem.
Beck