-
1. Re: Var doesn't work if I load external swf.
Ned Murphy Nov 8, 2012 4:22 AM (in response to nikolaig)The way you say you have redone things, you should still be declaring the sourceVar in the main timeline of the main file as you originally had it so that it is available to both sections of the main file. Your loaded swf is already targeting it there.
There are a variety of ways you could approach the design, so it's up to you in that respect. You could have the main file deal with all the code and target the loaded swf to assign whatever interactions are required of it.
-
2. Re: Var doesn't work if I load external swf.
nikolaig Nov 8, 2012 6:59 AM (in response to Ned Murphy)Thank you for your reply.
Please let me know if all the animation code should be left in the external SWF file (which is being loaded) and all the linkage code on the main time line?
If so then the code block specifying the link and loading on the botton:
var sourceVar:String;
//JTV_SatelliteCenterpiece_btn////////////////////////////////////////////////////
//event listener//
howTo_mainInfo.JTVs.JTV_SatelliteCenterpiece_btn.addEventListener(MouseEvent.CLICK, JTV_SatelliteCenterpiece_PlayVideoPopUp);
function JTV_SatelliteCenterpiece_PlayVideoPopUp(event:MouseEvent): void {
//MovieClip(parent.parent.parent).sourceVar="howto_popups/jtvs18w07_LG30.flv";
sourceVar="howto_popups/jtvs18w07_LG30.flv";
gotoAndPlay("flv_pb");
}
Should be left as it is on the main time line or only the function part and event listener put in the external SWF file?
I tried this way puttin the var and function on the main time line and it brings me to the proper page/labeled section but doesn't load the video.
In the OUTPUT Panel I have an error message:
VideoError: 1000: Unable to make connection to server or to find FLV on server
at fl.video::VideoPlayer/stop()
at fl.video::FLVPlayback/stop()
at acolyte46_howTo_Loader_fla::mainsite_mc_2/stopF2()[acolyte46_howTo_Loader_fla.mainsite_mc _2::frame283:49]
at flash.display::MovieClip/gotoAndPlay()
at acolyte46_howTo_Loader_fla::mainsite_mc_2/onClick_closeXhowToVideos_btn()[acolyte46_howTo _Loader_fla.mainsite_mc_2::frame283:28]
Frame 283 is "flv_pb" page/labeled section to where the links properly works but video is not being loaded?
Same code perfectly worked without any error message before I moved things into an external SWF file.
__________________________________________________________________________________________ ____________________________________
I am also confused why both ways are working out of the loaded SWF file:
MovieClip(parent.parent.parent).sourceVar="howto_popups/jtvs18w07_LG30.flv";
and
sourceVar="howto_popups/jtvs18w07_LG30.flv";
shouldn't only one be the correct one?
-
3. Re: Var doesn't work if I load external swf.
Ned Murphy Nov 8, 2012 7:16 AM (in response to nikolaig)If things that worked previosuly are no longer working then it is likely you are just confusing the design as you keep shifting things around.
For you own peace of mind, why don't you keep all of the code in the main file. Just load the external file and after it is loaded, assign the code to whatever elements it needs from the main file. If the loaded swf only has buttons that need to be clicked, then you can add the event listeners to those buttons from the main file after the swf has finished loading. This will get you back closer to the orginal coding which you indicate worked properly.
-
4. Re: Var doesn't work if I load external swf.
nikolaig Nov 8, 2012 8:08 AM (in response to Ned Murphy)If my code on the main time line was
howTo_mainInfo.JTVs.JTV_SatelliteCenterpiece_btn.addEventListener(Mous eEvent.CLICK, JTV_SatelliteCenterpiece_PlayVideoPopUp);
function JTV_SatelliteCenterpiece_PlayVideoPopUp(event:MouseEvent): void {
//MovieClip(parent.parent.parent).sourceVar="howto_popups/jtvs18w07_L G30.flv";
sourceVar="howto_popups/jtvs18w07_LG30.flv";
gotoAndPlay("flv_pb");
}
How I would access the elements if they were moved into the externally loaded SWF file. The file is named "howTo2_Q90imgs_Loader.swf"
and being loaded through the greensock's SWF loader this way:
loader_howToLoader = new SWFLoader("supporting files/building blocks/updated/howTo2_Q90imgs_Loader.swf",
could you give me a sample code to access those elements from the main timeline?
-
5. Re: Var doesn't work if I load external swf.
Ned Murphy Nov 8, 2012 8:57 AM (in response to nikolaig)You'll need to look into the properties of the SWFLoader class to see how to target the loaded content. I have not worked with that class so I'd be doing the same research you need to do to find out how to target the loaded item. It might have a property named "content" if it resembles the AS3 Loader in any way, which is what you would use to target the swf for the AS3 Loader class.
-
6. Re: Var doesn't work if I load external swf.
nikolaig Nov 8, 2012 2:04 PM (in response to Ned Murphy)Could you give me a code example if I were to use AS3 Loader (UILoader) I will try that and see if I can modify the code to greensock platform?
-
7. Re: Var doesn't work if I load external swf.
Ned Murphy Nov 8, 2012 2:50 PM (in response to nikolaig)If you want to use the UILoader component, then its "content" property is what points to the swf file that you load into it.
-
8. Re: Var doesn't work if I load external swf.
nikolaig Nov 8, 2012 6:52 PM (in response to Ned Murphy)Thanks, this method I know.
-
9. Re: Var doesn't work if I load external swf.
Ned Murphy Nov 8, 2012 7:06 PM (in response to nikolaig)You're welcome


