-
1. Re: How to add 1 swf file to another swf file which both are images sequences?
moccamaximum Oct 8, 2013 1:47 AM (in response to vari25)More details how you load the swfs are needed. Are both swfs loaded by a main swf? Do you use preloaders ? If yes: you should be able to make an alias for your loaded swf and be able to access all of its public properties/function from your main swf.
For detais, look here: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/LoaderInf o.html
Its crucial that you only try this after
Event.COMPLETE
has fired.
-
2. Re: How to add 1 swf file to another swf file which both are images sequences?
vari25 Oct 8, 2013 2:13 AM (in response to moccamaximum)Hi
I have the first swf as the main file.
To load the second swf file, the user has to click a particular button which is inside a movieclip that too in a certain keyframe.
The cose to load the second swf.
import flash.display.Loader;
import flash.net.URLRequest;
import flash.events.MouseEvent;var myLoader:Loader = new Loader();
int1_btn.addEventListener(MouseEvent.CLICK, interior);
function interior(event:MouseEvent):void
{
var myRequest:URLRequest = new URLRequest ("Interactive_Walkthrough.swf");
myLoader.load(myRequest);
addChild(myLoader);
myLoader.x = 0;
myLoader.y = -190;Object(root).cladding_panel_btn.visible = false;
Object(root).contrastbrick_panel_btn.visible = false;
Object(root).facebrick_panel_btn.visible = false;
Object(root).garage_panel_btn.visible = false;
Object(root).gutter_panel_btn.visible = false;
Object(root).rendercolor2_panel_btn.visible = false;
Object(root).rendercolor_panel_btn.visible = false;
Object(root).windowcolor_panel_btn.visible = false;
Object(root).roof_panel_btn.visible = false;
Object(root).trim_panel_btn.visible = false;
Object(root).reset_btn.visible = false;
Object(root).save_btn.visible = false;
}Any Help.
-
3. Re: How to add 1 swf file to another swf file which both are images sequences?
moccamaximum Oct 8, 2013 2:22 AM (in response to vari25)1. Always add an EVENT.COMPLETE.listener when you load sth.
//this variable will later be used to trigger behavior of your loadedSWf
var mc:MovieClip;
myLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, loaded);
function loaded(e:Event):void{
trace("LOADED");
addChild(myLoader);
mc= MovieClip(myLoader.content);
//you can now use the alias mc anywhere in your main swf to make the whole loadedSwf invisible or trigger a function in the swf
// for example: mc.hideMe() would trigger a function hideMe inside your loadedSWF
}
myLoader.load(new URLRequest("Interactive_Walkthrough.swf"));
-
4. Re: How to add 1 swf file to another swf file which both are images sequences?
vari25 Oct 8, 2013 2:53 AM (in response to moccamaximum)Thank u.
A small doubt again.
That is, if I want to hide the main swf (i.e.,the first swf)so that only the second would visible.
And I would give a button in the second swf to come back again.
Would That be possible?
Because I have tried to hide the first swf(i.e., the main swf) but nt working.
What could be done?
Many thanks in advance.
-
5. Re: How to add 1 swf file to another swf file which both are images sequences?
moccamaximum Oct 8, 2013 3:03 AM (in response to vari25)Since the main swf is the container which holds all loaded swf it is not possible to make it invisible without hiding all its children (the loaded swfs) too.
In this case it would be better to have a third, pretty much empty swf that does all the loading and treats both image sequences as children.
Since you most certainly need a thrid swf anyway, that acts a s a preloader in a webenvironment.
var l:Loader = new Loader();
var mc1:MovieClip;
var mc2.MovieClip;
l.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loop);
l.contentLoaderInfo.addEventListener(Event.COMPLETE, done);
l.load(new URLRequest("game.swf"));
function loop(e:ProgressEvent):void
{
var kBytesLoaded:int = Math.round(e.bytesLoaded/1024);
var kBytesTotal:int = Math.round(e.bytesTotal/1024);
Object(this).loaded_txt.text = kBytesLoaded;
Object(this).total_txt.text = kBytesTotal;
var perc:Number = kBytesLoaded / kBytesTotal;
trace("PERCENT:"+perc);
}
function done(e:Event):void
{
//removeChildAt(0);
addChild(l);
mc1= MovieClip(l.content);
}
// do this for both swfs and then you can have a function that switches between mc1/mc2 vibility whenver the relevant buttons are pressed
-
6. Re: How to add 1 swf file to another swf file which both are images sequences?
vari25 Oct 8, 2013 3:52 AM (in response to moccamaximum)That is create a new swf file with first to be loaded on opening the file.
And toggle visibility between these two swfs?
Am I wrong?
Thank u.
-
7. Re: How to add 1 swf file to another swf file which both are images sequences?
moccamaximum Oct 8, 2013 4:14 AM (in response to vari25)3 swfs:
main swf is principally only preloading tzhe other two:
your old main.swf and the Interactive_Walkthrough.swf
-
8. Re: How to add 1 swf file to another swf file which both are images sequences?
vari25 Oct 16, 2013 9:21 PM (in response to moccamaximum)Thank u.
I again want to know that, is it possible that the third(main) swf would be the only swf and after linking to the other swfs, the third swf run(work) individually in another location?
Hope I made myself clear.
Thank you in advance.
And is there any swf file to html converter?
Because wen I export the file to html i.e. publish, the html does not work independently. The swf file also have to be placed in the same location.
COuld it be possible to get a html file to work the same as swf without the swf file in its samelocation because the swf file is of rather large file size.
Thank u again.
-
9. Re: How to add 1 swf file to another swf file which both are images sequences?
moccamaximum Oct 16, 2013 11:28 PM (in response to vari25)I again want to know that, is it possible that the third(main) swf would be the only swf and after linking to the other swfs, the third swf run(work) individually in another location?
Believe me, even though its possible you don`t want to do that.
COuld it be possible to get a html file to work the same as swf without the swf file in its samelocation because the swf file is of rather large file size.
No, the html file is only a wrapper. Its pretty much like a parcel, and the swf is the birthday gift.
-
10. Re: How to add 1 swf file to another swf file which both are images sequences?
vari25 Oct 16, 2013 11:50 PM (in response to moccamaximum)Thank u but that clear and precise expalanation.
Believe me, even though its possible you don`t want to do that.
What does that mean, is there a possibility.?
curious to know.
Thank u so much.
And another doubt, that is, what could be done wrap all the associated files in a single file?
that is all necessary project files and folders.
What to do?
Thank You in advance.
-
11. Re: How to add 1 swf file to another swf file which both are images sequences?
moccamaximum Oct 17, 2013 12:00 AM (in response to vari25)you can use flashs
navigateToTORL function to navigate between a pair of swf/html files

