00:00
00:00
Newgrounds Background Image Theme

out-of-pocket just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

Embed Swf In Swf

5,866 Views | 14 Replies
New Topic Respond to this Topic

Embed Swf In Swf 2008-02-17 00:36:48


I'm trying to embed swfs in swfs... I tried

video.loadMovieNum("URL", 1); 

but that didn't help...

Any suggestions would be greatly appreciated.


Hello, from the past!

[ PHP: Main ]

BBS Signature

Response to Embed Swf In Swf 2008-02-17 01:38:56


Wait, what are you trying to do?


TU MADRE!

Response to Embed Swf In Swf 2008-02-17 11:01:56


I'm trying to play SWFs (instead of videos) in a SWF. So instead of a video player, or an FLV player, I want a SWF player, but nothing seems to be working...'


Hello, from the past!

[ PHP: Main ]

BBS Signature

Response to Embed Swf In Swf 2008-02-17 11:05:33


you mean like dynamicly load a .swf into another one? I wanted to do that aswell, because then you could upload the main .swf somewhere and just dynamicly load it into a .swf you submit to newgrounds, making it only about 10kb.


My websites: MayesMods | FireStorm | I'm also on almost every other website in existence, mostly under the username: andy70707 (youtube: brainiac777, eBay: 10andy70707).

BBS Signature

Response to Embed Swf In Swf 2008-02-17 11:13:19


loadMovieNum is a global function. You want MovieClip.loadMovie.


BBS Signature

Response to Embed Swf In Swf 2008-02-17 11:15:39


Figured it out. Realized it wasn't as hard as I thought.

Make an empty or so MC and call it VideoSWF (or whatever you want)
Then, add these actions to the MAIN TIMELINE:

VideoSWF.loadMovie("URL-TO-MOVIE");

I never realized it was that simple. I thought you need a long complicated process.. :o
Oh, and even if you upload the other swf somewhere else and submit the small one to NG, it still takes a load of time to load the other SWF. You're just tricking the users into thinking they're watching a short film when you have a 20 minute long flash that takes an hour to load. They never see anything but a white screen, and they end up blamming it...

So you're safer off uploading the original file, and asking Tom if it's over 10MB


Hello, from the past!

[ PHP: Main ]

BBS Signature

Response to Embed Swf In Swf 2008-02-17 11:29:14


Ok, small problem.

If I have the external SWF the same size as the SWF I'm using, how do I scale down the external SWF?
I'm loading it into a MC the size of 400 x 300 but it still takes over the entire screen instead of just the Movie MC.


Hello, from the past!

[ PHP: Main ]

BBS Signature

Response to Embed Swf In Swf 2008-02-17 11:38:58


couldnt u xscale and yscale the movie clip that has teh swf loaded into it?

Response to Embed Swf In Swf 2008-02-17 11:38:58


After you've loaded it, set the _width of the MC holding it to 400, and the _height to 300. It'll resize everything inside it to fit.

Response to Embed Swf In Swf 2008-02-17 11:41:37


Neither of them worked :o


Hello, from the past!

[ PHP: Main ]

BBS Signature

Response to Embed Swf In Swf 2008-02-17 12:33:04


Ok, here's what I got.

When I load the movie into the MC, without anything other than loadMovie affecting the MC (no ._width no ._height no ._x, ect.)
As soon as I add MC._width and MC._height the SWF I'm displaying stays at it's original size, but is rotated 90 degrees to the left and planted almost all the way off of the screen (only top part is on screen)

._xscale and _yscale do nothing.


Hello, from the past!

[ PHP: Main ]

BBS Signature

Response to Embed Swf In Swf 2008-02-18 06:22:21


hmm, I tried that myself and it DOES work but there are alot of errors with it... some buttons and movie clips don't play/work properly. Also, It gave me this incredibly long error message:

*** Security Sandbox Violation ***
SecurityDomain 'http://spamtheweb.com/ul/upload/180208/
40301_car_game_final.swf
' tried to access incompatible context 'file:///C|/Users/Andrew/AppData/Local/T emp/Untitled%2D2.swf'
*** Security Sandbox Violation ***
SecurityDomain 'http://spamtheweb.com/ul/upload/180208/
40301_car_game_final.swf
' tried to access incompatible context 'file:///C|/Users/Andrew/AppData/Local/T emp/Untitled%2D2.swf'
*** Security Sandbox Violation ***
SecurityDomain 'http://spamtheweb.com/ul/upload/180208/
40301_car_game_final.swf
' tried to access incompatible context 'file:///C|/Users/Andrew/AppData/Local/T emp/Untitled%2D2.swf'
*** Security Sandbox Violation ***
SecurityDomain 'http://spamtheweb.com/ul/upload/180208/
40301_car_game_final.swf
' tried to access incompatible context 'file:///C|/Users/Andrew/AppData/Local/T emp/Untitled%2D2.swf'
*** Security Sandbox Violation ***
SecurityDomain 'http://spamtheweb.com/ul/upload/180208/
40301_car_game_final.swf
' tried to access incompatible context 'file:///C|/Users/Andrew/AppData/Local/T emp/Untitled%2D2.swf'
*** Security Sandbox Violation ***
SecurityDomain 'http://spamtheweb.com/ul/upload/180208/
40301_car_game_final.swf
' tried to access incompatible context 'file:///C|/Users/Andrew/AppData/Local/T emp/Untitled%2D2.swf'
*** Security Sandbox Violation ***
SecurityDomain 'http://spamtheweb.com/ul/upload/180208/
40301_car_game_final.swf
' tried to access incompatible context 'file:///C|/Users/Andrew/AppData/Local/T emp/Untitled%2D2.swf'
*** Security Sandbox Violation ***
SecurityDomain 'http://spamtheweb.com/ul/upload/180208/
40301_car_game_final.swf
' tried to access incompatible context 'file:///C|/Users/Andrew/AppData/Local/T emp/Untitled%2D2.swf'
*** Security Sandbox Violation ***
SecurityDomain 'http://spamtheweb.com/ul/upload/180208/
40301_car_game_final.swf
' tried to access incompatible context 'file:///C|/Users/Andrew/AppData/Local/T emp/Untitled%2D2.swf'
*** Security Sandbox Violation ***
SecurityDomain 'http://spamtheweb.com/ul/upload/180208/
40301_car_game_final.swf
' tried to access incompatible context 'file:///C|/Users/Andrew/AppData/Local/T emp/Untitled%2D2.swf'
*** Security Sandbox Violation ***
SecurityDomain 'http://spamtheweb.com/ul/upload/180208/
40301_car_game_final.swf
' tried to access incompatible context 'file:///C|/Users/Andrew/AppData/Local/T emp/Untitled%2D2.swf'
*** Security Sandbox Violation ***
SecurityDomain 'http://spamtheweb.com/ul/upload/180208/
40301_car_game_final.swf
' tried to access incompatible context 'file:///C|/Users/Andrew/AppData/Local/T emp/Untitled%2D2.swf'
*** Security Sandbox Violation ***
SecurityDomain 'http://spamtheweb.com/ul/upload/180208/
40301_car_game_final.swf
' tried to access incompatible context 'file:///C|/Users/Andrew/AppData/Local/T emp/Untitled%2D2.swf'
*** Security Sandbox Violation ***
SecurityDomain 'http://spamtheweb.com/ul/upload/180208/
40301_car_game_final.swf
' tried to access incompatible context 'file:///C|/Users/Andrew/AppData/Local/T emp/Untitled%2D2.swf'
*** Security Sandbox Violation ***
SecurityDomain 'http://spamtheweb.com/ul/upload/180208/
40301_car_game_final.swf
' tried to access incompatible context 'file:///C|/Users/Andrew/AppData/Local/T emp/Untitled%2D2.swf'
*** Security Sandbox Violation ***
SecurityDomain 'http://spamtheweb.com/ul/upload/180208/
40301_car_game_final.swf
' tried to access incompatible context 'file:///C|/Users/Andrew/AppData/Local/T emp/Untitled%2D2.swf'
*** Security Sandbox Violation ***
SecurityDomain 'http://spamtheweb.com/ul/upload/180208/
40301_car_game_final.swf
' tried to access incompatible context 'file:///C|/Users/Andrew/AppData/Local/T emp/Untitled%2D2.swf'
*** Security Sandbox Violation ***
SecurityDomain 'http://spamtheweb.com/ul/upload/180208/
40301_car_game_final.swf
' tried to access incompatible context 'file:///C|/Users/Andrew/AppData/Local/T emp/Untitled%2D2.swf'
*** Security Sandbox Violation ***
SecurityDomain 'http://spamtheweb.com/ul/upload/180208/
40301_car_game_final.swf
' tried to access incompatible context 'file:///C|/Users/Andrew/AppData/Local/T emp/Untitled%2D2.swf'
*** Security Sandbox Violation ***
SecurityDomain 'http://spamtheweb.com/ul/upload/180208/
40301_car_game_final.swf
' tried to access incompatible context 'file:///C|/Users/Andrew/AppData/Local/T emp/Untitled%2D2.swf'
*** Security Sandbox Violation ***
SecurityDomain 'http://spamtheweb.com/ul/upload/180208/
40301_car_game_final.swf
' tried to access incompatible context 'file:///C|/Users/Andrew/AppData/Local/T emp/Untitled%2D2.swf'
*** Security Sandbox Violation ***
SecurityDomain 'http://spamtheweb.com/ul/upload/180208/
40301_car_game_final.swf
' tried to access incompatible context 'file:///C|/Users/Andrew/AppData/Local/T emp/Untitled%2D2.swf'
*** Security Sandbox Violation ***
SecurityDomain 'http://spamtheweb.com/ul/upload/180208/
40301_car_game_final.swf
' tried to access incompatible context 'file:///C|/Users/Andrew/AppData/Local/T emp/Untitled%2D2.swf'
*** Security Sandbox Violation ***
SecurityDomain 'http://spamtheweb.com/ul/upload/180208/
40301_car_game_final.swf
' tried to access incompatible context 'file:///C|/Users/Andrew/AppData/Local/T emp/Untitled%2D2.swf'


My websites: MayesMods | FireStorm | I'm also on almost every other website in existence, mostly under the username: andy70707 (youtube: brainiac777, eBay: 10andy70707).

BBS Signature

Response to Embed Swf In Swf 2008-02-18 06:28:58


lolz


In case you haven't noticed yet, this isn't my main anymore. PM me here.

BBS Signature

Response to Embed Swf In Swf 2008-02-18 06:42:20


At 2/17/08 12:33 PM, Momo-the-Monkey wrote: As soon as I add MC._width and MC._height the SWF I'm displaying stays at it's original size, but is rotated 90 degrees to the left and planted almost all the way off of the screen (only top part is on screen)

._xscale and _yscale do nothing.

See I've never had that problem. Because I always design external files to fit within the holding files I've designed...

You may want to set the files to scale and rotate AFTER the file's been loaded in, because the contents of the Movieclip are replaced by the movie being loaded in. Using loadMovie you can't set this up - there's no event fired when the movie is loaded. Using a MovieClipLoader object can help, but that's a bit more learning for you to do.

A very quick fix would be to set up an onEnterFrame function on the Stage that traces the width of the MC you're loading it into. Obviously it starts at zero, and goes above that when it loads the SWF in. So as soon as it goes above zero, transform the MC, rotate it the right way around, and delete the onEnterFrame function. Job done. Badly, but job done.

At 2/18/08 06:22 AM, andy70707 wrote: hmm, I tried that myself and it DOES work but there are alot of errors with it... some buttons and movie clips don't play/work properly. Also, It gave me this incredibly long error message:

Those errors occur when the URL you are attempting to load the movie from has not permitted files to be accessed by Flash. By default, no website permits Flash to access it's information (or rather, the Flash Player sees there's no permission explicitly defined, and refuses to connect to the file. These features are known as the security sandbox, and stop things like stealing Flash files or accessing information from outside of the sites permitted).

These are fixed by a crossdomain.xml being placed in the root of the site's folder. You'll have to ask the very nice people who run spamtheweb to do that for you. I'm expecting the answer will be a big, fat, no however, because they obviously DON'T want people hotlinking files through Flash like this, as it'd cut thier advertising revenue AND spike thier bandwidth at the same time. Heartless bastards. :p


...

BBS Signature

Response to Embed Swf In Swf 2008-02-18 07:32:34


erm, I suppose I could always host it on my website... what code do I have to put on it to make it work?


My websites: MayesMods | FireStorm | I'm also on almost every other website in existence, mostly under the username: andy70707 (youtube: brainiac777, eBay: 10andy70707).

BBS Signature