Re: [Flashcoders] If a URL starts with “http://” will clip always be loaded into REMOTE sandbox?
Anthony, thank you! How is it possible? On 6 June 2010 19:50, Anthony Pace wrote: > You can bypass this with javascript, and canvas. > > > On 6/5/2010 1:58 PM, Henrik Andersson wrote: > >> Pavel Repkin wrote: >> >>> Seems to be a question for a Flash security guru. >>> >>> Suppose we are loading an external SWF movie with >>> MovieClipLoader.loadMovie(url:String) Is it safe to assume that if url >>> starts with "http://";, the movie will be loaded in REMOTE sandbox? >>> >>> >> Yes >> >> ___ >> Flashcoders mailing list >> Flashcoders@chattyfig.figleaf.com >> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders >> >> > ___ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] [RE:] flash game source code
found this in 0.25 seconds, but didn't download to check it: Yes, Eric, I also found that link in 0.25 seconds, and the download stopped at 31% each of the 3 times I tried to download it. Your response was rude and condescending. Maybe you should consider that some of the people that post here do search on Google before posting. In fact, I spent a significant amount of time on several search engines looking for this, and I was unable to find what I was looking for. As I indicated in my original post, I found lots of emulators, but that's not what I want to do. I also found several references to the PushButton engine version, but that won't work for me either. Anyway, thanks to everyone else who responded. I finally found what I was looking for. Foundry Designs Inc. Professional Website Design and Online Marketing Mike Stocke msto...@foundrydesigns.com 248.787.1306 _ The New Busy think 9 to 5 is a cute idea. Combine multiple calendars with Hotmail. http://www.windowslive.com/campaign/thenewbusy?tile=multicalendar&ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_5___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] If a URL starts with “http: //” will clip always be loaded into REM OTE sandbox?
You can bypass this with javascript, and canvas. On 6/5/2010 1:58 PM, Henrik Andersson wrote: Pavel Repkin wrote: Seems to be a question for a Flash security guru. Suppose we are loading an external SWF movie with MovieClipLoader.loadMovie(url:String) Is it safe to assume that if url starts with "http://";, the movie will be loaded in REMOTE sandbox? Yes ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] External Interface with looped parameters
Whenever you need to pass a variable number of arguments, check Function.apply().It generally will be the answer to your problem! If I understood your problem correctly, this should do what you want: var args:Array = [0,1,2,3,4,5]; var jsFunctionName:String = "someJsFunction"; var parameters:Array = args && args.length > 0 ? [jsFunctionName].concat(args) : [jsFunctionName]; ExternalInterface.call.apply(null,parameters); Since ExternalInterace::call is static, the first param (the "this" context object) is null. The parameters are passed to the function as if you had written them in source code like func(param1,param2,param3), etc, as opposed to func(paramsArray). Now, this works because ExternalInterface::call expects the first param to be the name of function to be called and a variable (and optional) list of parameters. So, you just have to build an array that contains in its first position the function name and after that the rest of the args you want to pass. In this example, this is equivalent to this code: ExternalInterface.call(jsFunctionName,0,1,2,3,4,5); Cheers Juan Pablo Califano 2010/6/6 Ashim D'Silva > The last 2 weeks were crazy and I completely lost track of this so I > apologise for not responding to the answers (cheers though!). We > couldn't find a solution so we used an array instead, but the idea was > this. > > I have: > > var objs:Array = [1, 2, 3, 4, 5]; // arbitrary length defined by the > number of parameters I receive from the XML. > > I want to pass it to javascript like this: > > ExternalInterface.call('jsFunc', objs[0], objs[1], objs[2], …); > > so that the JS can use whatever params are provided. > > I realise now however, that passing an Array (or name-value pairs) is > a far more stream-lined method of achieving this, but I'm still > curious if I could in fact build a function in a loop and then call it > after. Interpretive languages could possibly handle this real easily, > but is there an interesting workaround? > > Maybe something like: > > var st:String = "function() { jsFunc("; > for each(var i:String in objs) > { > st += i+", "; > } > st+=");"; > > ExternalInterface.call(st); > > It's reaching for stupidity because I lose the beautiful automatic > Array conversion that AS3 does, but curiosity has the better of me at > the moment. > > Cheers, > > Ashim > > The Random Lines > www.therandomlines.com > > > > > On 28 May 2010 22:13, Anthony Pace wrote: > > > > > If you want an array from javascript to actionscript > > > > > somewhere in your class put something like: > > > > ExternalInterface.addCallback('SWFReceiver', as3Receiver); > > > > but remember that you need a receiver in as3: > > > > public function as3Receiver(a:Array /*or object, or *, etc...*/):void > { > > //do something with your array > > } > > > > then in js: > > > >var swfo = document.getElementById('idOfYourSwfElement'); > >swfo.SWFReceiver(yourArrayObject); > > > > > > > if you want an array from AS3 to javascript > > > > > > > var dataScript:XML= new XML(""); > > ExternalInterface.call(dataScript); > > > > > > > > On 5/26/2010 3:07 AM, Ashim D'Silva wrote: > >> > >> This seems fairly impossible but if there's an awesome way to do it > >> I'll be heaps grateful. > >> > >> I receive a function name and a set of parameters via XML > >> > >> > >> > >>webtrends > >> > >>98780 > >>Joseph > >>Iceland > >> > >> > >> > >> > >> I'm hoping there's a way for me to fire an ExternalInterface.call() > >> function with any amount of parameters provided to me. > >> I'm one step away from telling the other side I'll send them an array, > >> but hoping for the long shot. > >> > >> Cheers, > >> > >> Ashim > >> > >> The Random Lines > >> www.therandomlines.com > >> ___ > >> Flashcoders mailing list > >> Flashcoders@chattyfig.figleaf.com > >> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > >> > >> > > > > ___ > > Flashcoders mailing list > > Flashcoders@chattyfig.figleaf.com > > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > > > ___ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] External Interface with looped parameters
What you are suggesting, is almost the same as I suggested, except that you are avoiding the xml object and instead using a string; however, because of how a string is converted when passing the data, I wouldn't recommend it for anything too complex. On 6/6/2010 7:13 AM, Ashim D'Silva wrote: The last 2 weeks were crazy and I completely lost track of this so I apologise for not responding to the answers (cheers though!). We couldn't find a solution so we used an array instead, but the idea was this. I have: var objs:Array = [1, 2, 3, 4, 5]; // arbitrary length defined by the number of parameters I receive from the XML. I want to pass it to javascript like this: ExternalInterface.call('jsFunc', objs[0], objs[1], objs[2], …); so that the JS can use whatever params are provided. I realise now however, that passing an Array (or name-value pairs) is a far more stream-lined method of achieving this, but I'm still curious if I could in fact build a function in a loop and then call it after. Interpretive languages could possibly handle this real easily, but is there an interesting workaround? Maybe something like: var st:String = "function() { jsFunc("; for each(var i:String in objs) { st += i+", "; } st+=");"; ExternalInterface.call(st); It's reaching for stupidity because I lose the beautiful automatic Array conversion that AS3 does, but curiosity has the better of me at the moment. Cheers, Ashim The Random Lines www.therandomlines.com On 28 May 2010 22:13, Anthony Pace wrote: If you want an array from javascript to actionscript somewhere in your class put something like: ExternalInterface.addCallback('SWFReceiver', as3Receiver); but remember that you need a receiver in as3: public function as3Receiver(a:Array /*or object, or *, etc...*/):void { //do something with your array } then in js: var swfo = document.getElementById('idOfYourSwfElement'); swfo.SWFReceiver(yourArrayObject); if you want an array from AS3 to javascript var dataScript:XML= new XML(""); ExternalInterface.call(dataScript); On 5/26/2010 3:07 AM, Ashim D'Silva wrote: This seems fairly impossible but if there's an awesome way to do it I'll be heaps grateful. I receive a function name and a set of parameters via XML webtrends 98780 Joseph Iceland I'm hoping there's a way for me to fire an ExternalInterface.call() function with any amount of parameters provided to me. I'm one step away from telling the other side I'll send them an array, but hoping for the long shot. Cheers, Ashim The Random Lines www.therandomlines.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] External Interface with looped parameters
The last 2 weeks were crazy and I completely lost track of this so I apologise for not responding to the answers (cheers though!). We couldn't find a solution so we used an array instead, but the idea was this. I have: var objs:Array = [1, 2, 3, 4, 5]; // arbitrary length defined by the number of parameters I receive from the XML. I want to pass it to javascript like this: ExternalInterface.call('jsFunc', objs[0], objs[1], objs[2], …); so that the JS can use whatever params are provided. I realise now however, that passing an Array (or name-value pairs) is a far more stream-lined method of achieving this, but I'm still curious if I could in fact build a function in a loop and then call it after. Interpretive languages could possibly handle this real easily, but is there an interesting workaround? Maybe something like: var st:String = "function() { jsFunc("; for each(var i:String in objs) { st += i+", "; } st+=");"; ExternalInterface.call(st); It's reaching for stupidity because I lose the beautiful automatic Array conversion that AS3 does, but curiosity has the better of me at the moment. Cheers, Ashim The Random Lines www.therandomlines.com On 28 May 2010 22:13, Anthony Pace wrote: > > If you want an array from javascript to actionscript > > somewhere in your class put something like: > > ExternalInterface.addCallback('SWFReceiver', as3Receiver); > > but remember that you need a receiver in as3: > > public function as3Receiver(a:Array /*or object, or *, etc...*/):void { > //do something with your array > } > > then in js: > > var swfo = document.getElementById('idOfYourSwfElement'); > swfo.SWFReceiver(yourArrayObject); > > > if you want an array from AS3 to javascript > > > var dataScript:XML= new XML(""); > ExternalInterface.call(dataScript); > > > > On 5/26/2010 3:07 AM, Ashim D'Silva wrote: >> >> This seems fairly impossible but if there's an awesome way to do it >> I'll be heaps grateful. >> >> I receive a function name and a set of parameters via XML >> >> >> >> webtrends >> >> 98780 >> Joseph >> Iceland >> >> >> >> >> I'm hoping there's a way for me to fire an ExternalInterface.call() >> function with any amount of parameters provided to me. >> I'm one step away from telling the other side I'll send them an array, >> but hoping for the long shot. >> >> Cheers, >> >> Ashim >> >> The Random Lines >> www.therandomlines.com >> ___ >> Flashcoders mailing list >> Flashcoders@chattyfig.figleaf.com >> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders >> >> > > ___ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders