Go Back   Northcode Support > SWF Studio > SWF Studio V3
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
Old 2005-07-14, 01:49 PM   #1
4d3
FI
 
4d3's Avatar
 
Join Date: May 2004
Location: Jakarta
Posts: 114
global function problem

I have a problem with executing global function from loaded .swf file with secure load.

I've made a global function in main application than try to execute that function in my loaded movie... but it didn't work. The function is not executed.

PHP Code:
in main.swf :
_global.globalTrace = function ()
{
    
ssDebug.trace("calling Global Function");
};
ssSecure.loadMovie({url"assets\\child.swf"target"_root.clip_mc"});


in child.swf:
globalTrace(); 
it works if using flash actionscript for trace and loadMovie method, the function sucessfully executed.

here an example I've made
4d3 is offline   Reply With Quote
Old 2005-07-14, 01:56 PM   #2
mbd
Administrator
 
mbd's Avatar
 
Join Date: Jun 2002
Location: Ottawa
Posts: 4,368
I posted this in another thread where you asked the same question, but it definitely belongs in it's own thread

Is the loaded SWF a different version than the main SWF? For example, was the loaded SWF published for Flash player 6 and the main SWF published for Flash player 7?


mbd
mbd is offline   Reply With Quote
Old 2005-07-14, 02:16 PM   #3
jeffxpx
You can call me Jeff
 
jeffxpx's Avatar
 
Join Date: Aug 2003
Location: GA
Posts: 445
This could be something like Jesse Warden was recently mentioning on his blog (maybe 2 weeks ago). I didn't mention the specific post because it mentions one of their competitors.

In the child SWF, try putting this code before you make the call:

Code:
System.security.allowDomain(_parent._url);
Hope that helps. Let us know.
jeffxpx is offline   Reply With Quote
Old 2005-07-14, 03:18 PM   #4
4d3
FI
 
4d3's Avatar
 
Join Date: May 2004
Location: Jakarta
Posts: 114
both files were published in flash player 7
and I have try to put this code
Code:
System.security.allowDomain(_parent._url);
still didn't work...

global function work when executed in main movie but not in external movie
4d3 is offline   Reply With Quote
Old 2005-07-14, 03:24 PM   #5
mbd
Administrator
 
mbd's Avatar
 
Join Date: Jun 2002
Location: Ottawa
Posts: 4,368
How are you loading the child SWF? What code?


mbd
mbd is offline   Reply With Quote
Old 2005-07-14, 03:41 PM   #6
4d3
FI
 
4d3's Avatar
 
Join Date: May 2004
Location: Jakarta
Posts: 114
Code:
in main.swf :
_global.globalTrace = function ()
{
    ssDebug.trace("calling Global Function", "#ff00ff");
};
ssSecure.loadMovie({url: "assets\child.swf", target: "_root.clip_mc"});


in child.swf:
globalTrace();
4d3 is offline   Reply With Quote
Old 2005-07-15, 01:45 AM   #7
4d3
FI
 
4d3's Avatar
 
Join Date: May 2004
Location: Jakarta
Posts: 114
Looks like not only global function/vars but also a a variabel in main movie cannot called using _root or this._parent in loaded movie using secure load.

So I have manage to secure all my files... but I can't do anything with that it's not good...

Can anyone help me on this

here my script in main movie
Code:
_global.testVar = "this is global var";
rootVar = "call variabel using root";
parentVar = "call variabel using parent";
_global.globalTrace = function(arg) {
	ssDebug.trace(arg);
}
ssSecure.loadMovie({url:"assets\\child.swf",target:"_root.clip_mc"});
//ssSecure.loadMovie({url:"assets\\child.swf",target:"this.clip_mc"}); fail to load using this.clip_mc
//ssSecure.loadMovie({url:"assets\\child.swf",target:"clip_mc"}); success to load using clip_mc
//clip_mc.loadMovie(ssGlobals.ssStartDir+"\\assets\\child.swf");
globalTrace("call from parent");
here is my script in child movie
Code:
_global.ssDebug.trace(testVar);
root_txt.text = _root.rootVar;
parent_txt.text = this._parent.parentVar;
this._parent.globalTrace("call from child with this._parent");
_root.globalTrace("call from child with _root");
globalTrace("call from child");
its only work if I use attributes AutoExtract with Encription and loadmovie using clip_mc.loadMovie(ssGlobals.ssStartDir+"\\assets\\child.swf");
all function and variabel was successfully executed and called.

But I need to use No AutoExtract with Encription for my project...



here is my SWF Studio project file
Attached Files
File Type: spx secureload.spx (53.6 KB, 403 views)
4d3 is offline   Reply With Quote
Old 2005-07-15, 07:43 AM   #8
mbd
Administrator
 
mbd's Avatar
 
Join Date: Jun 2002
Location: Ottawa
Posts: 4,368
This has been found to be a security issue with the Flash player. When you load a movie securely through the API the parent SWF understands the child SWF to be from a different domain and so limits the child SWF's access.

We're working on a solution that will be invisible to SWF Studio users.


mbd
mbd is offline   Reply With Quote
Old 2005-07-15, 08:01 AM   #9
4d3
FI
 
4d3's Avatar
 
Join Date: May 2004
Location: Jakarta
Posts: 114
wow... I think it's a crucial bug since most of developer wants to secure their files without limitation of function/vars access among .swf files.

I hope this could be fixed A.S.A.P... I really need to secure my project files
4d3 is offline   Reply With Quote
Old 2005-07-17, 02:13 PM   #10
4d3
FI
 
4d3's Avatar
 
Join Date: May 2004
Location: Jakarta
Posts: 114
just wondering if this issue have been fix yet?

because I really need the solution on this... secured files & granted access between swf
4d3 is offline   Reply With Quote
Old 2005-07-18, 01:02 PM   #11
mbd
Administrator
 
mbd's Avatar
 
Join Date: Jun 2002
Location: Ottawa
Posts: 4,368
For you project, and possibly other projects, would you be loading all SWFs from the secure layout, or a mixture of files from the layout and some from external sources?


mbd
mbd is offline   Reply With Quote
Old 2005-07-18, 02:09 PM   #12
4d3
FI
 
4d3's Avatar
 
Join Date: May 2004
Location: Jakarta
Posts: 114
I would like to load all .swf file type from secure layout 'cause every child swf have some function to communicate with main application.
4d3 is offline   Reply With Quote
Old 2005-07-22, 03:47 PM   #13
4d3
FI
 
4d3's Avatar
 
Join Date: May 2004
Location: Jakarta
Posts: 114
any update on this?

because I have to release my project this monday... I guess I have to use attribute AutoExtract & encrypt...
on next update I hope attribute No AutoExtract & encrypt can work properly without messing with props and vars access
4d3 is offline   Reply With Quote
Old 2005-07-22, 03:53 PM   #14
Dan
Super Moderator
 
Dan's Avatar
 
Join Date: May 2003
Location: Ottawa
Posts: 396
4d3,

We think we have a solution for that issue, and we might be able to get it together for Monday, but I can't guarantee anything.
Dan is offline   Reply With Quote
Old 2005-07-22, 04:45 PM   #15
4d3
FI
 
4d3's Avatar
 
Join Date: May 2004
Location: Jakarta
Posts: 114
thanks alot Dan,
I hope i can get some light on Monday
4d3 is offline   Reply With Quote
Old 2005-08-05, 06:14 AM   #16
4d3
FI
 
4d3's Avatar
 
Join Date: May 2004
Location: Jakarta
Posts: 114
Any fix on this issue? I really need this ASAP
4d3 is offline   Reply With Quote
Old 2005-08-05, 11:09 AM   #17
northcode
Tim
 
northcode's Avatar
 
Join Date: May 2001
Location: Ottawa
Posts: 10,761
I created a problem report for this one and I'll be working on that next. I'd like to get this one done before we put out the maintenance release since it's pretty serious. I'm working on this one now.
northcode is offline   Reply With Quote
Old 2005-08-05, 11:47 AM   #18
jeffxpx
You can call me Jeff
 
jeffxpx's Avatar
 
Join Date: Aug 2003
Location: GA
Posts: 445
Pardon my OT intrusion on this thread.

Knowing your speed, you're probably almost done with this issue now that you have an idea in mind. However, regardless of whether this particular problem gets fixed, could you please upload a "maintenance release" at the end of today or early Monday morning?

I have a CD project that needs the Outlook Express Shell.invoke mailto: fix, and I have to burn some CDs on Monday for sure. The other guy who needs it probably could have used it a while ago too.

Seems like the vacation did you a lot of good. You seem to be working even faster than before. Keep up the pace.

Thanks.
jeffxpx is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.