Welcome to TalkGraphics.com
Results 1 to 10 of 13

Hybrid View

  1. #1
    Join Date
    Nov 2004
    Location
    Israel
    Posts
    2,538

    Default LoadMovie from a website

    I have recieved a banner to load into my website. The banner turned out to be 1 kb empty swf. When I upload it on my website it shows some ad that the person who sent it to me can change.

    Since I need to work with different companies and give them my banners I've decided to try and copy the idea of sending them one empty swf file and just using a LoadMovie command to load different files from my server.

    I assumed that it works with loadMovie command and tried to use:

    mc.loadMovie ("http://www.2b.sce.ac.il/banner.swf");

    or loadMovie ("http://www.2b.sce.ac.il/banner" , "mc");

    (Or something like that).

    The problem is it doesn't work!

    My question is: Is it possible to load a movie clip from an external url? And f not is there another simple way to achieve such a task?

    Thanks,

    Availor.
    IP

  2. #2
    Join Date
    Sep 2000
    Location
    Bracknell, UK
    Posts
    8,659

    Default Re: LoadMovie from a website

    Availor, you might be encountering the "sandbox" restrictions of the flash player - it stops you from reading files from a domain other than the one the web page is loaded from.

    Be interesting to know more about the swf that was given to you. Ask the author how it works.

    Paul
    IP

  3. #3
    Join Date
    Nov 2006
    Posts
    1,602

    Default Re: LoadMovie from a website

    onLoad () {
    loadMovieNum("http://www.wer2b.com/loadingdock/test/wer2blayout1311a.swf",0);
    }


    this works fine by me,only thing if playing in Flashplayer your firewall may give a call.
    when in your site this must work easy
    (use this technic myself all the time
    have a small site and a big one to put my pics and ext.swf there and have the little site load externaly(use Swishmax for scripting)

    see attachment

    Gr.Hans
    Attached Files Attached Files
    IP

  4. #4
    Join Date
    Nov 2006
    Location
    Hertfordshire
    Posts
    123

    Default Re: LoadMovie from a website

    Hi

    From what I’ve read on this issue pauland seems to be right.

    So I had a browse of a book I bought a few months back on flash (although I haven’t tried it out yet)

    This is a quote from the book.


    In Flash player 7, cross-movie scripting is permitted only between movies originating from the same domain. Any other cross-movie scripting works only after calling System.securtiy.allowDomain to permit access. The following example shows how you would use System.securtiy.allowDomain to permit access to www.myserver.comand www.adomain.com


    System.security.allowDomain(“www.myserver.com”.”www.adomain.com” );


    Let us know how you get on,
    Last edited by manny2k; 06 January 2007 at 02:36 PM.
    IP

  5. #5
    Join Date
    Nov 2004
    Location
    Israel
    Posts
    2,538

    Default Re: LoadMovie from a website

    Thanks for your reply!

    If it works for haakoo I see no reason why it shouldn't work for me. I have no firewall.

    There is a tutorial describing the process. Maybe I just mistyped something.

    I will try haakoo's method using the onLoad command.

    Thanks again.
    IP

  6. #6
    Join Date
    Nov 2006
    Posts
    1,602

    Default Re: LoadMovie from a website

    http://www.kunstfocus.nl/loadingdock/extload.html

    here file one resides and loads from here

    www.wer2b.com


    Not restricted to onloadfunction
    I have load it in to a _level,but you can also load into a sprite/MC
    IP

  7. #7
    Join Date
    Nov 2006
    Location
    Hertfordshire
    Posts
    123

    Default Re: LoadMovie from a website

    that was a nice piece of work haakoo
    IP

  8. #8
    Join Date
    Sep 2000
    Location
    Bracknell, UK
    Posts
    8,659

    Default Re: LoadMovie from a website

    I think that the Flash security sandbox is a bit more subtle than might be appreciated (of course it may not have anything to do with Availors problem at all). If a flash swf (main.swf, say) is running and has been loaded from domain a.com, it can load another swf (second.swf) from b.com into another level, but what is prohibited is main.swf and second.swf exchanging data in any way, or loading a swf from domain b.com into MovieClip created as part of the main.swf.

    So you can load .swf files from different domains, but they cannot exchange data in any way: http://www.adobe.com/go/tn_16629

    Anyway, I freely admit it's not a problem I've had (but then again I've not been accessing data across multiple domains), but I disagree if people say it's not a problem that can exist. It may or may not be a problem for Availor, that all depends on the code that he has and nobody has seen that.

    Paul
    IP

  9. #9
    Join Date
    Nov 2006
    Location
    Hertfordshire
    Posts
    123

    Default Re: LoadMovie from a website

    I’ve just done it using the following code which is pretty much the same as you tryed, I did notice a typo error in your first post Availor, you put “ “around the target MC, I know this might be stating the obvious but have you also given your target MC an instance name


    loadMovie("http://www.adomain.co.uk/pic1.swf",my_MC);


    manny2k
    IP

  10. #10
    Join Date
    Aug 2000
    Location
    Harwich, Essex, England
    Posts
    21,931

    Default Re: LoadMovie from a website

    Sorry Availor I wasn't with you in the first post. In the Blank swf place the following code on frame1:

    Code:
    loadMovieNum("http://www.availor.com/flash/target.swf",1);
    You can then just change target.swf on your server to have it show the new file. (Unless it's been cached on the viewers computer)

    I've just tried it here by loading a swf to the forum with a link back to a swf on my site and it loaded fine. I took it down after as I just wanted to test it. If you PM me i'll give you a url so you can test it yourself.

    Cautionary note: Allowing swf files that you have no control over nor any knowledge of their contents is a security risk for your sites server.
    Although this article is about clickTags it holds equaly true here as you've no idea whether the click is being directed to an http site or elsewhere.

    Here's the relevant text from the link below:
    Note: The ActionScript in this Flash advertisement is verifying that the clickTAG URL begins with "http:". This is an important security measure. If you do not take this precaution, a malicious HTML page could source your SWF and pass a clickTAG URL that begins with "javascript:" or another scripting pseudo-protocol. If your ActionScript code were to call getURL with a maliciously crafted JavaScript URL, it would be possible for the site serving the malicious HTML page to obtain the contents of your HTTP cookies or perform other actions on your site's behalf.
    http://www.adobe.com/resources/richm...signers_guide/
    Last edited by Egg Bramhill; 08 January 2007 at 01:17 AM.
    Egg

    Minis Forum UM780XTX AMD Ryzen7 7840HS with AMD Radeon 780M Graphics + 32 GB Ram + MSI Optix Mag321 Curv monitor
    + 1Tb SSD + 232 GB SSD + 250 GB SSD portable drive + ISP = BT + Web Hosting = TSO Host
    IP

 

 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •