PDA

View Full Version : what am I doing wrong????


denise1
03-07-2002, 04:43 PM
It seems I can't even get the simple actions going. Any help at all would be greatly appreciated.

I'm trying to load external swf's with button releases.

I have a code on the preloader as follows:
loadMovie ("name.swf", "_root.mccontainer1");

The button has the following code:
on (release) {
loadMovie ("name.swf", _root.mccontainer1);
gotoAndPlay ("play");
Variable = "1";
}

there's obviously something wrong because the buttons never execute when i upload.

THANKS AGAIN! denise "the humble"

tg
03-07-2002, 04:47 PM
is 'name.swf' in the same folder on the webserver as your html page?
is 'mccontainer1' the correct instance name for your mc?

denise1
03-07-2002, 05:09 PM
the mccontainer1 is the instance name, but I do have the swf in a different folder on my server. Does this mean I can't use a relative path? THANKS FOR RESPONDING TG!

tg
03-07-2002, 06:09 PM
you can use relative paths, but the path you have given flash here is the same folder as your html. i believe it needs to be relative to the html page your flash is embedded in, not relative to you flash file.

denise1
03-07-2002, 06:28 PM
oh, TG, I'm sorry but I'm still so confused. Can you give me an example of the code I might use.

If I've preloaded the movie with
loadMovie ("xxx.swf", "_root.mccontainer1");
//aren't i telling it to park in the mccontainer1 until it is called? So wouldn't the code on the button release be relative to flash and not my html?

thanks again! denise

Tink
03-07-2002, 06:46 PM
do ur files have to be in different folders?

try putting all ur files in the same folder and using ur origonal script. the problem is that ur main movie is searching in the folder it is in for the new movie to load in but it isn't there.

cheers

BLEEDA

denise1
03-07-2002, 06:55 PM
THANKS MUCH TG AND BLEEDA!

denise1
03-08-2002, 12:27 PM
I tried what you said, but I still can't get my movies to load on the button release. I really need some help here because I can't get passed this -- I'm obviously missing something that's so obvious!! HELP!! Thanks, denise

pinkaboo
03-08-2002, 01:31 PM
you can use relative paths, but the path you have given flash here is the same folder as your html. i believe it needs to be relative to the html page your flash is embedded in, not relative to you flash file.

TG is kinda right here, when you load a swf into another swf the path has to be relative to where the html page is (Flash gets confused and thinks that the main swf is in the same folder as the html file and then tries to find the swf to load in from that location) so you either have to make sure all your files are in the same folder together or...

...add some code to your html page to confirm where the main swf is located, it will then know which folder it is in and any relative paths will be just fine. ta da! (phew)

I'm talking about the base attribute as evidenced in this snippet from a html file (I think I've just pasted the right bit anyway!):


<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"
WIDTH=400 HEIGHT=420>
<PARAM NAME=movie VALUE="teenchat.swf"> <PARAM NAME=menu VALUE=false> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#003366>
<PARAM NAME="BASE" VALUE="/images/teenchat/swfs">

<EMBED src="teenchat.swf" menu=false quality=high bgcolor=#003366 WIDTH=400 HEIGHT=420 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"
BASE="/images/teenchat/swfs"></EMBED>
</OBJECT>


However, Denise1, if you have already tried to see if your problem is the paths by putting all your files in one folder together and that still doesn't work - i'm not sure what's going on there. Will have another little think though ;)

K

pinkaboo
03-08-2002, 01:37 PM
hmm, I seem to have broken the forum width *shrug* how strange.

anyhow, just found these macromedia tech notes which probably explains the whole base attribute a whole heap better than I just did!

technote - base attribute using geturl (http://www.macromedia.com/support/flash/ts/documents/tn4157.html)
talks about it in relation to geturl but I believe it is the same principle for any relative paths

technote- tag attributes (http://www.macromedia.com/support/flash/ts/documents/tag_attributes.htm)

K

denise1
03-08-2002, 01:52 PM
I will check these out!!! Thank you so much. Wish me luck putting it all together. Will let you know! Thanks again, denise

pinkaboo
03-08-2002, 02:01 PM
heh heh - wishing you luck!

;)

K

Tink
03-08-2002, 02:56 PM
can u post the .fla

BLEEDA

denise1
03-08-2002, 03:54 PM
I know this is bad, but this is my first try at computer programming - so you don't have to be gentle! I've never even posted an fla before. I read the rules and I put the fla file on my site (www.perverseverse.com). You guys/gals have been so patient with me, I truly appreciate it, because I swear I feel like ripping my hair out.

pinkaboo
03-08-2002, 04:02 PM
sorry Denise I just tried your url and got a "site under construction page". Have you got the direct url to the file? Or you can post a .fla directly onto this thread in the forum if it is small and you zip it up first.

K

denise1
03-08-2002, 05:03 PM
Okay, got it zipped and hopefully attaching ...

denise1
03-08-2002, 05:04 PM
okay - hope this works

denise1
03-08-2002, 06:46 PM
i have my file zipped and saved in my c:\drive but it's not sending the attachment ... i swear if i don't have a breakdown soon ... sorry and thanks for any advice -- i've just never done this before

pinkaboo
03-08-2002, 06:53 PM
not to worry - do you want to try mailing it to me instead? It's the weekend now so I can't promise an immediate solution but I can try to take a look.

my email is in my footer

K

tg
03-08-2002, 08:38 PM
how large is your zipped file? if it is too large, you won't be able to attach it to the forums... can you give us another link to your file on your web server?

pinkaboo
03-08-2002, 10:42 PM
OK, Denise1 - I got your file (blimey! - ahem *blushes*) (oh it was HUGE - when you zip something up you don't then need to attach the original file again as well! I just had to download almost 7 mg then!) but, cos I'm nice (ahem), I've had a quick look and I think we've been barking up the wrong tree as you have some fundamental problems:

ok, first off you have broken your movie into individual swfs and are loading them in on command so that the user only has to download the movies as and when he/she requires them. It is therefore not necessary to have them all loading in during the preload phase. The idea is to break it up into bite size chunks that will download quickly when needed - not to break it up and then stuff it all back into the first frame.

next - you are trying to load your movies into an empty mc container, except that that mc doesn't seem to exist on the timeline at the point you are trying to load in the movies. There is no mc on the timeline for the movies to load into.

also- although you need to cut the loadmovie bit out of the preloader I will also mention that there is no point having a great long list of swfs loading into the same movie one after the other. The mc can only hold one swf at a time so each successive load pushes the last out - waste of time.

ok - now on to the button:

in this scene you do have the container mc on the timeline at the right place - except that it is hidden (and you might need to add another frame so that it also exists on frame2 like the rest of the scene?). You have the mc on the bottom layer and above it are at least two layers that completely obliterate the view of the mc. I think you are loading in the swfs - you just can't see them because, for example, the pink bg layer is on top of it.

ok, that's it for now, *yawn* I'm going to go to sleep now methinks. hope that is of some help to you anyway. good luck. if I think of/spot anything else I'll let you know!

K

denise1
03-11-2002, 11:38 AM
PINK, I REALLY APPRECIATE ALL YOUR HELP!!!!!!!!!!!!! AND YOUR NICENESS!!! (I'll figure out how to zip properly - that was my first time).

THANK YOU EVER SO MUCH!!!!! denise