-
Senior Member
this.content.loadMovie("HELP")
I haven’t used flash in about three months so I may be missing something blindingly obvious, but:
I have set up my new flash movie, the main movie for my site which I want to load all my sections into as external swf’s.
I have set up a test page swf
I have set up the content mc, with the instance name “content”.
I have set up the buttons in the main page, with the code;
on (release) {
this.content.loadMovie("home.swf");
}
(home.swf being the test page)
When clicked nothing happens!! But if I put the same code, less the on (release) part, on the first frame of the movie it works!! What am I doing wrong??
Thanks.
-
Senior Member
try
on (release) {
_root.content.loadMovie("home.swf");
}
A spark of light in a dark wibbly wobbly world
-
Senior Member
No difference...
Like I say the code works just not with the button, I must be missing someting but I can't think what!
-
Sure the code is on the button and not on a frame action?
Don't you get an error?
Try adding a trace to your script, to see if you at least get a response from the button... Make sure the Omit trace actions, is not checked in the Publish Settings, on the Flash tab.
on (release) {
trace("yo!");
_root.content.loadMovie("home.swf");
}
-
Senior Member
No error messages! Even if I remove the home.swf from the folder and re-test it doesn't give an error message! If I create a new button it works, so I have obviously broken something along the way. The button I am trying to use has another button in side it, which has a movie clip inside that, which has a button inside that which has action assigned to it also, so I’m assuming it’s something to do with that??
-
You can't have buttons within buttons!
-
Senior Member
Oh, well that'll be it then
Thanks
-
Senior Member
New problem... well maybe the same problem (possibly my ignorance).
I have a movie clip, with a button inside. On release I want the movie to jump to a different scene:
on (release) {
this._parent.gotoAndStop("boys",1);
}
“boys” being the scene I want to jump to.
No joy, I get no error message, it just doesn’t do anything!
I assume it’s something to do with the fact that the button is inside a movie clip but I don’t know how to get around this?
-
Senior Member
no as long as you have no on(press) type actions on the MC the button in it will work...
use the trace("hit"); type thing to make sure it gets there tho...
and try root.gotoAndStop("boys",1); unless its a loaded swf in the main swf then u have to use this._parent... or this._parent._parent.
also check little things like capitals in boys... no offence but its often done (by me...)
A spark of light in a dark wibbly wobbly world
-
Senior Member
No, just a normal movie clip with an animation inside, and a button over the top of that (for roll over effect).
on (rollOver) {
play();
}
on (rollOut) {
gotoAndPlay(11);
}
on (release) {
this._parent.gotoAndStop("boys",1);
}
I’ve tried:
root
_root
_parent
Nothing works!
I have copied the button from the movie clip and pasted into the main scene, omitted the _parent bit to make sure I hadn’t got any unwanted characters in there and it worked fine (I have fallen foul to accidental spaces at the end of scene names)
I know I must be doing something really really stupid to cause this, but can’t work out what
-
Senior Member
on (release) {
this._parent.gotoAndStop("boys",1);
}
change to
on (release) {
trace("OK");
this._parent.gotoAndStop("boys",1);
}
as i think it may be the anim thats doing it...
u know that you can put a MC in the buttons over/pressed state for animation?? sounds like that would be easier...
A spark of light in a dark wibbly wobbly world
-
Senior Member
It gave me a message window that said OK every time I clicked.
I have used the exact same type of button in other swf’s for the same site (as in has the same animation in a movie clip with a button over the top) that call external swf’s into a content MC and they work fine.
I know you can put a MC into the over state of the button, the problem is that I want the image beneath the button to fade to 25%alpha when rolled over and fade back to full opacity when rolled out, not just jump back the the “up” state.
Maybe if I set a frame on the main stage with that action I could have my button tell the whole movie to goto that frame??
-
Senior Member
good...
im just thinking but u have a MC in the main time line that MC has a button in it with actions on that
so...
this referes to the button
this._parent refers to the MC
this._parent._parent reffers to the main timeline... (maybe)
tho _root. should work...
tho maybe thats for controling MC only (as they don't have scenes?)
so try just gotoAndStop("boys",1);
lable the frame you want to go to as in gotoAndStop("boys","start");
so to sum up put all these variations in the press function if it works use the debugger to find which one is a winner...
A spark of light in a dark wibbly wobbly world
-
Never target scene names, but labeled frames instead...
Check my first post in this thread...
http://www.flashkit.com/board/showth...hreadid=584159 // labels
-
Senior Member
In the end I put a frame action on the main stage saying goto the scene I want etc, and in the button a _parent goto that frame. Very @r$e about t!t but it works alright.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|