×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 20
  1. #1
    Registered User
    Join Date
    Sep 2008
    Posts
    8

    Loading external files in Web Runtime with Flash Lite

    I have created a movie that uses MovieClip.loadMovie and XML.load functions that all works fine on my PC and when I run the flashlite swf on an N95 using the Flash Player.

    However when I put the flash movie into a Web Runtime Widget both the loadMovie and Xml.load functions cannot load any files. I have tried both modes of "local files only" and "network access only" and looking at the security level it says "local trusted".

    I've created a flashlite 3.1 file and flashlite 3.0 versions. Neither work. Is this a limitation of using flash in web runtime that it is impossible to access external files or can someone provide me with a solution.

    Thanks,

    Tim Brooke

  2. #2
    Nokia Developer Champion
    Join Date
    Jul 2008
    Location
    Pakistan
    Posts
    1,065

    Smile Re: Loading external files in Web Runtime with Flash Lite

    Quote Originally Posted by timbrooke@hotmail.com View Post
    I have created a movie that uses MovieClip.loadMovie and XML.load functions that all works fine on my PC and when I run the flashlite swf on an N95 using the Flash Player.

    However when I put the flash movie into a Web Runtime Widget both the loadMovie and Xml.load functions cannot load any files. I have tried both modes of "local files only" and "network access only" and looking at the security level it says "local trusted".

    I've created a flashlite 3.1 file and flashlite 3.0 versions. Neither work. Is this a limitation of using flash in web runtime that it is impossible to access external files or can someone provide me with a solution.

    Thanks,

    Tim Brooke
    I think u r missing one thing that is CROSSDOMAIN.XML. This file must be present in the root of ur server. To know what is crossdomain.xml and how to configure it.Please search in this dibo .I and other write many times about it.

    BTW : Flash lite 3.1 is better for testing.

    Best Regards,
    SajiSoft

  3. #3
    Registered User
    Join Date
    Sep 2008
    Posts
    8

    Re: Loading external files in Web Runtime with Flash Lite

    I added a crossdomain.xml file with <allow-access-from domain="*" /> but that doesn't seem to work. I even added a System.security.loadPolicyFile("crossdomain.xml"); Just to force it to load the policy file 'cos I've no idea what the site root directory is in a widget but still no luck.

    I even tried putting the flash file in a folder called trusted but still does not seem to work. Any other ideas?

    Thanks,

    Tim

  4. #4
    Nokia Developer Champion
    Join Date
    Jul 2008
    Location
    Pakistan
    Posts
    1,065

    Smile Re: Loading external files in Web Runtime with Flash Lite

    Quote Originally Posted by timbrooke@hotmail.com View Post
    I added a crossdomain.xml file with <allow-access-from domain="*" /> but that doesn't seem to work. I even added a System.security.loadPolicyFile("crossdomain.xml"); Just to force it to load the policy file 'cos I've no idea what the site root directory is in a widget but still no luck.

    I even tried putting the flash file in a folder called trusted but still does not seem to work. Any other ideas?

    Thanks,

    Tim
    Root directory can be explained by this example .Suppose u have a server www.myserver.com (This is the server from where u have to load the xml files and Movieclips) than ur crossdomain.xml must be there www.myserver.com/crossdomain.xml . In crossdomain.xml , write this code :
    Code:
    <?xml version="1.0"?>
    		
    	    <!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
    		
    	    <cross-domain-policy>
    		
    	    <allow-access-from domain="*" />
    		
    	    </cross-domain-policy>
    Now, Put the below code in ur swf file's first frame to load the policy file:
    Code:
    System.security.loadPolicyFile("http://myserver.com/crossdomain.xml");
    and
    (Optional Step) simply put ur swf file in the root of ur server i.e www.myserver.com/myapp.swf.
    I will recommend u to test it first as a standalone swf & if every thing works fine then embedd it into a widget.
    If the server from where u r loading a xml or movie clip is not urs , then u have to proxy the server in ur crossdomain.xml .
    If the problem exists then please explain that what kind of errors u get in the standalone mode while running ur swf file. Either internet connection pop up doesnt appear or every thing works fine but when u load a movie or an xml then it raises an exception.
    Hope it helps u...

    Best Regards,
    SajiSoft

  5. #5
    Registered User
    Join Date
    Sep 2008
    Posts
    8

    Re: Loading external files in Web Runtime with Flash Lite

    Thanks for your explanation about crossdomain.xml but...

    I'm not using a web server. The whole point of this post hence the title "Web Runtime with Flash Lite" is that I'm creating a web runtime widget that I am into which I am embedding a flash lite file. So it's not on a server or using the same kind of root structure you would imagine on a website. Web runtime is a stand alone way of incorporating web like applications onto your phone as a application like thing.

    Does anyone have any experience of trying to use loadmovie or xml.load from within a WRT? Does it work? Because I don't seem to be able to make it work. But perhaps someone out there has a magical combination of settings that will allow a flash file embedded in a WRT widget to load external movie and xml files which also reside in the same directory on a phone.

    Still hopeful,

    Tim

  6. #6
    Nokia Developer Champion
    Join Date
    Jul 2008
    Location
    Pakistan
    Posts
    1,065

    Smile Re: Loading external files in Web Runtime with Flash Lite

    Quote Originally Posted by timbrooke@hotmail.com View Post
    Thanks for your explanation about crossdomain.xml but...

    I'm not using a web server. The whole point of this post hence the title "Web Runtime with Flash Lite" is that I'm creating a web runtime widget that I am into which I am embedding a flash lite file. So it's not on a server or using the same kind of root structure you would imagine on a website. Web runtime is a stand alone way of incorporating web like applications onto your phone as a application like thing.

    Does anyone have any experience of trying to use loadmovie or xml.load from within a WRT? Does it work? Because I don't seem to be able to make it work. But perhaps someone out there has a magical combination of settings that will allow a flash file embedded in a WRT widget to load external movie and xml files which also reside in the same directory on a phone.

    Still hopeful,

    Tim
    I m sorry , i think i misunderstood u .I am explaining a Swf embedded into a web page & the web page is uploaded to a server but the WRT widgets case is somewhat different. I will surely do some tests when get some time and let u know what r my results.

    Best Regards,
    SajiSoft

  7. #7
    Nokia Developer Champion
    Join Date
    Jul 2008
    Location
    Pakistan
    Posts
    1,065

    Smile Re: Loading external files in Web Runtime with Flash Lite

    My phone doesnt support widgets as few s60 3rd edition FP1and All FP2 phones are supported. But still i think i can solve this issue.
    Sometimes , loading a movie needs an absolute path .Usually, in flash we just load the external files by the name of the swf .FOr example :
    Code:
    loadMovie("child.swf", _root);
    Which means that child.swf is placed in the same folder as our main swf file is or in other words ,loading of child.swf is dependent on our main swf file location.But in some cases for example if u embedded a swf file into a symbian c++ exe then it needs an absolute path .Most probably bcoz the exe file copies the swf file to a private directory and then open it (which means now main swf file fails to load a child.swf bcoz now the main swf is not any more in the directory). In such case, if u use the absolute path then it loads the child file no matter what is the location of the main file. Absolute path means a path with complete description. FOr example :
    Code:
    loadMovie("file://\\e:\\others\\child.swf", "_root");
    May be same is the case with widgets. So , y not give a test to the above discussion.Simply, create a main swf file (which is included in ur .wgz) having a AS on its first frame :
    Code:
    loadMovie("file://\\c:\\child.swf", "_root");
    & export it with LOCAl Playback Security settings.Now , make a child.swf having a rectangle or something on its body which shows its presence when it is loaded. PUT THIS child.swf file in C: by using PC suite or any tool. Now install ur wgz and run the application to check out whether main.swf loads the movie from c:\child.swf or not. I think it may help me to know that whether widgets support loading a swf file or not. Hope this discussion is helpful for u..

    Best Regards,
    SajiSoft

  8. #8
    Registered User
    Join Date
    Sep 2008
    Posts
    8

    Re: Loading external files in Web Runtime with Flash Lite

    So I like the direction this is going.

    I put a flash file in the e:\others directory on the phone and got the flash file in the widget to point to it using the full path as descibed: loadMovie("file://\\e:\\others\\child.swf", "_root");

    The flash file was actually loaded! So it does look like getting the correct path would help. But what is the correct path? I don't seem to be able to find any documentation about where widgets are stored when they are installed on the phone. And why the flash file seems to be out of step with the source location.

    So I think the problem has been identified but no solution yet.

    Tim

  9. #9
    Nokia Developer Champion
    Join Date
    Jul 2008
    Location
    Pakistan
    Posts
    1,065

    Smile Re: Loading external files in Web Runtime with Flash Lite

    Quote Originally Posted by timbrooke@hotmail.com View Post
    So I like the direction this is going.

    I put a flash file in the e:\others directory on the phone and got the flash file in the widget to point to it using the full path as descibed: loadMovie("file://\\e:\\others\\child.swf", "_root");

    The flash file was actually loaded! So it does look like getting the correct path would help. But what is the correct path? I don't seem to be able to find any documentation about where widgets are stored when they are installed on the phone. And why the flash file seems to be out of step with the source location.

    So I think the problem has been identified but no solution yet.

    Tim
    When u install a wgz file it gets install in a private directory.Just like jar installation in 3rd edition .So , hard to trace in which folder it get install but not impossible. (U can use an explorer signed with all capablities and look into the private (i.e !:\private) folder to know that in which folder it get installed) . Other way is to install the swf files into a visible directory like c:\others or e:\others along with ur wgz. Now, a question may arise that how to complete this task? Just pack the wgz and external swf files together and provide it to the end user.Here is a useful post 4 u :
    Widgets in a sis
    However, i beleive there are also some other ways to package a wgz e.g using Alpana Studio .
    Hope it helps u..& Best Of Luck...

    Best Regards,
    SajiSoft

  10. #10
    Registered User
    Join Date
    Sep 2008
    Posts
    8

    Unhappy Re: Loading external files in Web Runtime with Flash Lite

    Actually the whole reason I was using a wgz file was to avoid needing to build a sis file. Seems that for when you want a flash file to load other files from a local directory wgz is not suitable.

    Oh well.

    Tim

  11. #11
    Product Specialist
    Join Date
    Jun 2003
    Location
    UK
    Posts
    191

    Re: Loading external files in Web Runtime with Flash Lite

    Hi Tim,

    You should be using SIS format for applications that installed files locally. Widgets on S60 live in the browser and are subject to the same security that you'd expect there.

    Mark
    www.flashmobileblog.com
    Mark Doherty
    Developer Evangelist
    Adobe Systems, Mobile and Devices EMEA

  12. #12
    Registered User
    Join Date
    Sep 2008
    Posts
    8

    Re: Loading external files in Web Runtime with Flash Lite

    "Widgets on S60 live in the browser and are subject to the same security that you'd expect there.
    "

    The problem is that I don't think many people will expect that kind of security.

    With a widget the expectation is that you can create a standalone application based on web technology.
    So you can start a html file which can open local images and xml files that accompany it in the widget package. However a flash file cannont open local images and xml files that accompany it in the widget package. It's not a very consistent or easily comprehensible policy is it?

  13. #13
    Product Specialist
    Join Date
    Jun 2003
    Location
    UK
    Posts
    191

    Re: Loading external files in Web Runtime with Flash Lite

    We've designed the security model to be very flexible over it's 12 year history. There are two central pillars, web browsing and standalone mode. If you use Flash in the browser context then you adopt that security model, its consistent across every major platform.

    Once you get going with SIS files you'll realise that they aren't so bad. We're going to release a new version of the Adobe Mobile Packager soon that should alleviate many of the pain points. Alternatively Nokia have a Flash Packager for the same purpose which is great for testing, or if you use a Mac.

    Mark
    Mark Doherty
    Developer Evangelist
    Adobe Systems, Mobile and Devices EMEA

  14. #14
    Registered User
    Join Date
    Jan 2008
    Location
    Spain
    Posts
    54

    Re: Loading external files in Web Runtime with Flash Lite

    However a flash file cannont open local images and xml files that accompany it in the widget package. It's not a very consistent or easily comprehensible policy is it?
    Flash Lite CAN open local images and XML files that goes in the SIS package, even other files if you know the path to them.

    Marcos

  15. #15
    Nokia Developer Champion
    Join Date
    Jul 2008
    Location
    Pakistan
    Posts
    1,065

    Smile Re: Loading external files in Web Runtime with Flash Lite

    Quote Originally Posted by timbrooke@hotmail.com View Post
    Actually the whole reason I was using a wgz file was to avoid needing to build a sis file. Seems that for when you want a flash file to load other files from a local directory wgz is not suitable.

    Oh well.

    Tim
    I know its ur personal choice but if u dont mind can u please tell me y u dont like to use sis packaging? If u r afraiding of the signing issues then by looking at ur situation , i dont think u need to symbian sign ur sis .U just need to self sign ur sis and now-a-days u can create a self signed certifacate for free thats stays valid for 15 years from the date of creation. .

    Best Regards,
    SajiSoft

Similar Threads

  1. Sending external variable to flash lite file with php
    By Snalk in forum [Archived] Flash Lite on Nokia Devices
    Replies: 3
    Last Post: 2009-03-30, 08:04
  2. S60 2nd FP3 and 3rd - Flash Lite frustration
    By ilyadanilov in forum General Development Questions
    Replies: 7
    Last Post: 2006-02-08, 19:07
  3. CEikDialog Question
    By AdamBeck in forum Symbian
    Replies: 2
    Last Post: 2004-09-30, 19:40
  4. Dialogs within Symbian 6.0 based SDK
    By georgica1979 in forum Symbian User Interface
    Replies: 14
    Last Post: 2003-04-07, 15:29
  5. Unresolved external symbols problem
    By georgica1979 in forum Symbian User Interface
    Replies: 1
    Last Post: 2003-04-06, 13:26

Posting Permissions

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