View Full Version : Loading a SWF into a SWF and going to a specific frame
dave9621
01-24-2003, 06:49 PM
I am working on a simple flash site. I have a movie called "main" and when a button is clicked it loads a SWF file called "page1", and that is working perfectly. BUT I want to go to a specific frame number (or label) on "page1" when it loads.
The reason for this is that "main" has 5 menu items and each menu item will take you to a certain section of the "page1" timeline.
This sounds so simple, but I can't get it to work. I tried using variables to force it to go to a specific frame, but that isn't working either.
HELLLLLLLLLP!!
Thanks to all for helping.
CyanBlue
01-25-2003, 02:03 AM
Howdy... Welcome to the club... :)
Load your external SWF file into an empty movieclip, and use gotoAndPlay() function to go to the specific frame...
For example, if the empty movieclip's instance name is 'holder', you can go like this...(untested)
_level0.holder.loadMovie("yourSWFfile.swf");
_level0.holder.onData = function ()
{
_level0.holder.gotoAndPlay(5);
}Know what I mean???
How's Chicago's winter??? I used to live around UIC for five years and I remember the terrible weather... :p
dave9621
01-25-2003, 05:21 AM
Jason,
THANKS SO MUCH for the helpful reply. I get what you're driving at, but unfortunately I'm pretty stupid and I need you to explain it to me like I'm a 2 year old.
I created a MC called "holder", I placed it on an empty frame and labeled the frame "page1", I gave the MC an instance name of "holder".
I put the code you supplied into the movie clip, it didn't work.
I put the code onto the button with an "on release" and it didn't work.
I'm guessing the button should take you to the "page1" labeled frame (where the "holder" MC is located) and then the SWF should load into that empty frame, right?
As for the winter here in Chicago...Brrrrrrrrrrrrrrr...we've had some below zero nights recently, but hardly any snow so it's not too bad.
Thanks again for your help.
CyanBlue
01-25-2003, 06:30 AM
Below zero??? Hm... I guess it is worse than I though... I am sure all my friends in Chicago want to visit me... Well... I'm in VA... The lowest one I have seen so far was about 10... :)
Back to the question... I have created a sample for you... Open up the file and see if this can help you... Oh... Send me your mailing address so that I can charge you my 2cents... :D Kidding... Good luck... :)
dave9621
01-26-2003, 03:55 PM
Jason,
Me again...and still having trouble. Your code is brilliant and works perfectly...to a point. The problem I have is that my final SWF must be Flash 5 compatible and I can't use button instances to accomplish this. So I took your code and tweaked it to use it on my buttons. I can get the "external.swf" to load, but it doesn't start at the desired frame number and I'm wondering what I'm doing wrong. I have download a zip file to my server, it was too big to attach to this board...if you can spare a few minutes can you look at it for me???
goto www.muhrdesign.com/download/troubleFLA.zip
Thanks again for your time and help, without people like you I'd be lost at times.
It snowed here last night...Chicago is once again covered in an inch of whiteness and it's 14 degrees....you might miss Chicago pizza and beef sandwiches, but I'm sure you don't miss the winters.
CyanBlue
01-26-2003, 09:14 PM
Ahhhhhhhhhhh... 1.35mb... Do you know how long it takes to download that file with 56k??? I want my cable back... :( Unfortunately the apartment that I have moved doesn't have broadband connection... :(
I'm getting the file now and I'll take a look at it... But don't keep you hopes to high...
It's snowing in VA as of now... Not much, but it's nice to see if I don't go out... :) Yup... I really miss Chicago deep dish pizza that I used to get from downtown... and the Gyros from the Greek town... Oh, well... Winter??? Who cares... :D
Almost done downloading the file... Let me go get my hair cut and I need to wash my dogs and then I'll look into it... :D
dave9621
01-26-2003, 10:17 PM
Jason,
You're the best. Thanks for taking your time on this Superbowl Sunday. Whenever you have time, no hurry.
As for the pizza...you just can't get good pizza away from the windy city...it almost makes the winters bareable.
Also, sorry you lost your cable, that has GOT TO SUCK.
If you want to correspond directly, you can write me at dave@muhrdesign.com
Thanks again!
Dave
CyanBlue
01-26-2003, 11:49 PM
Yup... It DOES suck not to have broadband connection especially when you HAD one and don't have it anymore... Well... I guess this goes same to money...
Nah... I'm doing what I can do... If I cannot, I tell you I cannot... and there are many many people who are whole lot better than me in this place...
Superbowl??? I am not a big fan of football anyways... Don't worry about it... :)
Pizza... You are keep making me hungry... I am on diet... :(
> it almost makes the winters bareable.
In a way it is true because I will get more fat with pizza... and I did...
File is on the way to your email account... Let me know if you have further question... :)
dave9621
01-27-2003, 02:26 AM
Jason,
Your code work beautifully in my program, BUT when I swapped out the "external.swf" with my "page1.swf" I ran into problems. I think it has something to do with the levels. I guess I should have sent you all of the code in the first place. First there is an HTML page that loads my initial SWF called "loader.swf", this is where the "main.swf" loads from. I'm getting some very strange results...such as the page doesn't load at all OR it loads as an overlay (or underlay) of the main page...but it is always frame 1 of "page1.swf" and not the frame that the button instructed.
I'm too tired to work on it now, I'm going to try again tomorrw. Thanks again for all of your help. I might be asking for help again, this thing is really driving me nuts!
And I'm sorry to hear about your no-pizza diet...man, that's a bummer, I'm trying to cut back too...but life without pizza isn't really life at all, is it?
CyanBlue
01-27-2003, 11:59 AM
Yo, dave... :)
I just got up and getting myself ready to go to work... Upload your files again and let me know when it is ready... You can PM me... I won't be having much time since it's work day, but I'll take a look at it... See ya... :)
dave9621
01-28-2003, 02:59 AM
Jason,
All is well my friend. I gave up, it kicked my ass, I'm a beaten man...but there are plenty of ways to skin a cat. I ended up adding all of the code to one SWF, instead of loading one SWF into another SWF. It made my SWF 40k bigger, but it's still workable. The final is at www.muhrdesign.com/sitelis have a look if you're interested.
Thanks again for your patience and help...you probably haven't heard the last from me. It's nice to have a resource that is so generous. If I can help you with anything in the future, just ask...I'm a graphic designer and have been for almost 20 years, so if you ever need help in that line (PhotoShop, InDesign, Illustrator, PageMaker, etc.), I'm your man.
Take care,
Dave
CyanBlue
01-28-2003, 11:17 AM
Howdy... :)
Glad to hear that all is well and the project is done...
Sorry to hear that you had to give it up... I guess that goes with F5 compatibility... Was there any specific reason why the project should be done in F5??? Well... I've seen people doing in in F4 a couple of days as a matter of fact... :D
Um... I am not that generous as you think... I could be mean and evil to the person who doesn't do their homework... :p You could look up the old threads and see how mean I was... Hehe...
Let me know when you have questions... and I'll do the same when I have questions... :)
dave9621
01-28-2003, 01:18 PM
Jason,
I'm working in MX of course, but I want my SWFs to be Flash 5 viewer compatible because I think the majority of people haven't upgraded to the Flash 6 plug-in and I want to eliviate any potential conflicts or putting the visitor through the whole upgrading process. In a year or so when everyone is on the same plug-in I can say goodbye to publishing in Flash 5 for good! Can't wait because Mx has some stuff that makes our lives easier (like components) that I'm unable to use since Flash 5 players don't support them. sigh...
And yes, you're quite mean...a nice person would have flown to Chicago and fixed my code while I slept so that everything would be working when I awoke. Bastard! :p
C ya.
Dave
CyanBlue
01-29-2003, 03:55 AM
So... You are still struggling yourself to make up your mind, eh???
I was on that way too... Actually, I started using FMX about a year ago, I guess... My memory is not what it used to be... :( I thought about upgrading to FMX from F5 many many many days, but there wasn't much market out there at the time... But the issue of components and new objects swirled me into the world of FMX... Well... I guess I like it so far... :)
Of course, it all depends who your audiences are... If your audiences are kinda dumb to have F5 plugin installed, then you gotta go for F5... But I guess it is about time for you to get out of the shell and enjoy 110% of FMX... I guess that's how things are changing thesedays... All the new computers have Flash plugin installed as a default, and most of the Flash sites that I go to requires FMX plugin... So, chances are pretty slim that many people still have F5 plugin installed... :D
Here are some numbers from the mothership... It won't be exact number, but that sounds about right as far as I see it...
http://www.macromedia.com/software/player_census/flashplayer/
http://www.macromedia.com/software/player_census/flashplayer/forecast.html
So... I just became mean, eh??? From Best to Mean??? What is the odd to that??? :p I was about to head to IAD to get myself fly to ORD, but the security was too heavy at the airport... and they kicked me out from there... I guess I am kinda dangerous too... :D Send me your address and phone number so that I could order some pizzas for you... :p
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.