View Full Version : Attached movie - doesn't call out...need help
Gabra53
04-01-2003, 02:21 AM
Hi, I have tried attaching and loading a movieclip in the library when a navigation button is pressed, but it doesn't work.... the MC is supposed to load on the main scene in the lowest layer(backdrop).... anyone knows how to solve this problem?
Script used:
on (press) {
this._parent.attachMovie("surfclip", "surfclip", 1);
surfclip.gotoAndPlay(5);
}
black
04-01-2003, 04:41 AM
Originally posted by Gabra53
Hi, I have tried attaching and loading a movieclip in the library when a navigation button is pressed, but it doesn't work.... the MC is supposed to load on the main scene in the lowest layer(backdrop).... anyone knows how to solve this problem?
Script used:
on (press) {
this._parent.attachMovie("surfclip", "surfclip", 1);
surfclip.gotoAndPlay(5);
}
I cant see the contents of your zip and please show more details~ :)
havent looked at your code yet, will get to it if i have time later today...
but i noticed a couple of things..
either use this, or use _parent, but don't use this._parent... it may be confusing things...
the other is if you want _parent.attachMovie(...)
then you should change your next line of code to:
_parent.surfclip (since it was attached on the parent - and not on the current time line.).
i looked at your code, and what i suggested, seems to work.
however, you may want to rethink the organization of your code... try to keep your code in one location/ or at one point for each object... it makes troubleshooting/debugging much easier.
let me explain what i mean.
inside your mc 'submenu-open' you have 14 keyframes... 12 of them contain buttons... the first button key frame has 1 mc/button and that button has the code you gave us above on it.
the next button key frame has 2 mc/buttons and each of those buttons has the above code.. the next has 3 buttons and each has the above code on it. by the time you get to the last keyframe, you have 11 buttons each with the above code on it.
so that means you have 66 places to change the above code, if it needs to be edited.
a better design would be to place the code inside your mc in the library, then if you need to attach it, the code goes with the mc, and you only have one place to ever edit the code...
look thru the threads here, and learn how to dynamically attach mcs in a loop (also look in the movie section or library section for grids/graphs) the insert an onrelease method inside your loop.
ok, sorry, i've gone on too long here. good luck with your project.
Gabra53
04-02-2003, 01:58 AM
Hey, thanks alot tg! it worked!... but not what i really had in mind....(will come to it in a while) :)
Ok, I myself think that my organization is crappy and makes debugging a problem for some :P but i also realise that because i might want to add in more "square" buttons to the navigation in future, it promt me to use such reckless ways.... i was wondering if i had created a new symbol for every "square" button with a script embedded inside.... I would still have to edit each symbol if problems arises. But of couse, it would definetely be lesser like wat I did now wouldn't it? I'll keep your words of wisdom tg! Thanks!
Ok, now for the project....
think i got lost/side track from the start... I actually wanted to do a navigation which calls out images to be loaded on the spot (in the background of the main scene) only when the button is pressed.
In short, i was looking for a way to solve this problem that flash wouldn't load everything from the start, and only load certain objects (like this MC) when I clicked a button or something...
I am currently separating the images to a external swf file and try calling from there... so far still no progress but will keep trying....
Need your advise and wisdom too!
P.S Sorry for the extremely long reply :P
mc.loadMovie("myjpg.jpg"); i believe will load a jpg file into flash with out it having to be in a swf file. (flash mx)
i havn't tried it, cause i only work with dbs and data, but im pretty sure it works.
Gabra53
04-02-2003, 10:25 AM
...couldn't access the net whole day long.............
tg, just realised is it true that anything you load into _level0 will, by definition, destroy all content in the Flash player session -- all variables, all other levels AND the movie currently running in _level0 (the one that loaded from the HTML)???
If that's the case, it wouldn't help would it? Coz the ultimate goal is to load an image on the main scene together with other layers and navigation.... appearing on the lowest level so that the rest of the layers stay above it.....
Arghhh... going bonkers here.... need help.....
Thanks again!
i personally don't use _level* much.
in your code, create an empty movie clip load your content into the clip and use swapdepths() to git it to load infront of or behind other objects on your page.
or on your timeline, create a new layer below all of your other layers, and put an empty mc that layer... place the mc where you want the upper left hand corner of your loaded image to be.
give it an instance name, and load your images into that. they will always show up below everything else.
Gabra53
04-03-2003, 05:53 AM
ok, i have manage to use an external swf to load the images( thanks tg!):
on (press) {
gotoAndPlay ("surf");
loadMovie ("surfimages.swf", "/dummy");
}
it loads the external swf with all the images inside to the main scene on layer dummy (dummy MC attached)......
the problem now is that how do i restrict the thumbnail buttons in such a way that if the second/third/fourth image(depending on which thumbnail is at) to be loaded (from the external swf) is ready, then the 2nd/3rd/etc. square thumbnail will appear, following the 3rd, 4th, 5th and so on....
i have actually uploaded the file at:
http://www.manic.com.sg/clients/test/
u can see the test results by navigating through:
> portfolio > surf > *to each thumbnails...
Gabra53
04-03-2003, 08:14 AM
can anyone help pls???
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.