# \[mx\] pls help correct this code

**URL:** https://forum.kirupa.com/t/mx-pls-help-correct-this-code/13936
**Category:** Uncategorized
**Created:** [February 20, 2003, 12:23am UTC](https://forum.kirupa.com/t/mx-pls-help-correct-this-code/13936 "2003-02-20T00:23:33Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![Lacuna](https://avatars.discourse-cdn.com/v4/letter/l/edb3f5/32.png) [@Lacuna](https://forum.kirupa.com/u/Lacuna)
#### Post date: [February 20, 2003, 12:23am UTC](https://forum.kirupa.com/t/mx-pls-help-correct-this-code/13936/1 "2003-02-20T00:23:33Z")

</div>

I’m attempting to create a clickable source from a movie clip  
so that when the user clicks on the movie clip another movie clip (specifically ‘profilecover.swf’) loads in a separate area of the screen. I’ve used the following code… can someone let me know what factors should be changed so I can do the above…

\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_ code:

onClipEvent (load) {  
this.createEmptyMovieClip(“pcover”,1);  
pcover.loadMovie(“profilecover.swf”);  
this.onEnterFrame=function(){  
var l=pcover.getBytesLoaded();  
var t=pcover.getBytesTotal();  
if (l \> 0 && l \>=t){  
pcover.\_x=170;  
pcover.\_y=30;  
}  
}

\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_ end code.

:love:  
~ S. Blaze

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 20, 2003, 12:38am UTC](https://forum.kirupa.com/t/mx-pls-help-correct-this-code/13936/2 "2003-02-20T00:38:03Z")

</div>

And what seems to be the problem? :tie:

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 20, 2003, 1:57am UTC](https://forum.kirupa.com/t/mx-pls-help-correct-this-code/13936/3 "2003-02-20T01:57:24Z")

</div>

i get the following:

* * *

Scene=Scene 1, Layer=profile, Frame=53: Line 11: Clip events are permitted only for movie clip instances  
onClipEvent (load) {

Scene=Scene 1, Layer=profile, Frame=53: Line 22: Syntax error.

* * *

but i thought i was making it for an instance…[stumped]

:love:  
~ S. Blaze

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 20, 2003, 2:10am UTC](https://forum.kirupa.com/t/mx-pls-help-correct-this-code/13936/4 "2003-02-20T02:10:59Z")

</div>

I dont get much of those types of errors…

but i think it means you need to Give an instance name to th MC

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 20, 2003, 2:19am UTC](https://forum.kirupa.com/t/mx-pls-help-correct-this-code/13936/5 "2003-02-20T02:19:02Z")

</div>

how do i give an instance name to a mc that is being externally loaded with several layers of it’s own… sorry if it seems to be an easy question.

:love:  
~ S.Blaze

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 20, 2003, 2:23am UTC](https://forum.kirupa.com/t/mx-pls-help-correct-this-code/13936/6 "2003-02-20T02:23:28Z")

</div>

Were did you put the External Loading code

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 20, 2003, 2:26am UTC](https://forum.kirupa.com/t/mx-pls-help-correct-this-code/13936/7 "2003-02-20T02:26:30Z")

</div>

it’s in the code on the first post…?? is that not correct?

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 20, 2003, 2:27am UTC](https://forum.kirupa.com/t/mx-pls-help-correct-this-code/13936/8 "2003-02-20T02:27:35Z")

</div>

the actual mc i am loading is in the same folder as the main file.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 20, 2003, 3:02am UTC](https://forum.kirupa.com/t/mx-pls-help-correct-this-code/13936/9 "2003-02-20T03:02:25Z")

</div>

> Scene=Scene 1, Layer=profile, Frame=53: Line 11: Clip events are permitted only for movie clip instances  
> onClipEvent (load) {

Scene=Scene 1, Layer=profile, Frame=53: Line 22: Syntax error.

the code is supposed to be used in the movie clip actions and you’re placing it in the timeline … 🙂

if you want to use it from the timeline it should be something like this:

```auto
instance.createEmptyMovieClip("pcover", 1);
pcover.loadMovie("profilecover.swf");
instance.onEnterFrame = function() {
	l = pcover.getBytesLoaded();
	t = pcover.getBytesTotal();
	if (l>0 && l>=t) {
		pcover._x = 170;
		pcover._y = 30;
	}
}

```

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 20, 2003, 3:05am UTC](https://forum.kirupa.com/t/mx-pls-help-correct-this-code/13936/10 "2003-02-20T03:05:16Z")

</div>

or in the mc actions:

```auto
onClipEvent (load) {
	this.createEmptyMovieClip("pcover", 1);
	pcover.loadMovie("profilecover.swf");
	this.onEnterFrame = function() {
		l = pcover.getBytesLoaded();
		t = pcover.getBytesTotal();
		if (l>0 && l>=t) {
			pcover._x = 170;
			pcover._y = 30;
		}
	}
}

```

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 20, 2003, 3:27am UTC](https://forum.kirupa.com/t/mx-pls-help-correct-this-code/13936/11 "2003-02-20T03:27:28Z")

</div>

ahhhhhh… none of this stuff is working!! let me try to explain because I must be leaving something out.

I have a movie clip - lets call it mc1 - (it can’t be a button because of it’s nature) that loads upon entering the keyframe.

Now I want mc1 to load ANOTHER movie clip - lets say mc2 - farther down the screen when someone clicks on mc1.

The PROBLEM arises because the mc1 loads on a blank keyframe which i therefore can’t change into a symbol and mc2 can’t contain the button properties because they need to click on the mc1 to make it work.

Am I just not understanding the above help or did i not properly explain myself originally? PLease PleAse help me out guys…i am at a total lost with this.

:love:  
~ S. Blaze

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 20, 2003, 3:43am UTC](https://forum.kirupa.com/t/mx-pls-help-correct-this-code/13936/12 "2003-02-20T03:43:08Z")

</div>

oops … sorry

i didn’t pay attention to your first post :-\

```auto
mc1.onRelease = function () {
	createEmptyMovieClip ("holder", 1)
	holder.loadMovie ("somefile.swf")
	this.onEnterFrame = function () {
		if (holder.getBytesLoaded() == holder.getBytesTotal()) {
			holder._x = 170
			holder._y = 30
		}
	}
}

```

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 20, 2003, 3:52am UTC](https://forum.kirupa.com/t/mx-pls-help-correct-this-code/13936/13 "2003-02-20T03:52:56Z")

</div>

so since mc1 cant have an instance name because it has to load on a blank keyframe…what do i do then…i am really really sorry that i am making this hard. I’ve also tried to create a button underneath the externally loaded mc1 but even when i increase the layer # on the button it stays underneath mc1… am i making any sense at all? I think this might just all sound like babble.

:love: ~ S. Blaze ~ :love:

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 20, 2003, 4:02am UTC](https://forum.kirupa.com/t/mx-pls-help-correct-this-code/13936/14 "2003-02-20T04:02:24Z")

</div>

you’re right … we’re making this too hard

> so since mc1 cant have an instance name because it has to load on a blank keyframe

the instance name will remain in every single frame of the whole movie

ok …

you have a movie … in x frame of the movie you load another movie containing mc1 ?? then you load another movie when mc1 is pressed ?? [size=1]:: confused ::[/size]

can you attach your files ? 🙂

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 20, 2003, 4:05am UTC](https://forum.kirupa.com/t/mx-pls-help-correct-this-code/13936/15 "2003-02-20T04:05:45Z")

</div>

1 sec and i’ll upload them

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 20, 2003, 4:08am UTC](https://forum.kirupa.com/t/mx-pls-help-correct-this-code/13936/16 "2003-02-20T04:08:09Z")

</div>

[size=1]:: takes a beer and waits ::[/size] 😛

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 20, 2003, 4:30am UTC](https://forum.kirupa.com/t/mx-pls-help-correct-this-code/13936/17 "2003-02-20T04:30:00Z")

</div>

~~whew…here we go…

check it out @ [http://www.cyberwebs.org/test/practice.swf](http://www.cyberwebs.org/test/practice.swf)

…i need this (which is an external mc) to be clickable and able to load mc2 which has about 6 or 7 of it’s own layers when you open it up as a separate file to edit.

:love:

And thanks a lot for all your patience and help Kax. I’ll owe you big for this one!

:love: :love: :love: S.Blaze

* * *

Also some other locations:

[http://www.cyberwebs.org/test/practice.swf](http://www.cyberwebs.org/test/practice.swf)  
[http://www.cyberwebs.org/test/practice.fla](http://www.cyberwebs.org/test/practice.fla)  
[http://www.cyberwebs.org/test/practice.html](http://www.cyberwebs.org/test/practice.html)

[http://www.cyberwebs.org/test/rgprofile.swf](http://www.cyberwebs.org/test/rgprofile.swf)  
[http://www.cyberwebs.org/test/rgprofile.fla](http://www.cyberwebs.org/test/rgprofile.fla)  
[http://www.cyberwebs.org/test/rgprofile.html](http://www.cyberwebs.org/test/rgprofile.html)

[http://www.cyberwebs.org/test/boxopener.swf](http://www.cyberwebs.org/test/boxopener.swf)  
[http://www.cyberwebs.org/test/boxopener.fla](http://www.cyberwebs.org/test/boxopener.fla)  
[http://www.cyberwebs.org/test/boxopener.html](http://www.cyberwebs.org/test/boxopener.html)

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 20, 2003, 4:47am UTC](https://forum.kirupa.com/t/mx-pls-help-correct-this-code/13936/18 "2003-02-20T04:47:11Z")

</div>

do you have a mac ?? i can’t open your files :-\

if you do … zip your files. usually it solves the problem =)

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 20, 2003, 5:08am UTC](https://forum.kirupa.com/t/mx-pls-help-correct-this-code/13936/19 "2003-02-20T05:08:00Z")

</div>

FINALLY…

Thanks for the continued help. Here’s the zip.

[Zip File](http://www.cyberwebs.org/test/rgprofile.zip)

:love: ~S. Blaze

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 20, 2003, 5:36am UTC](https://forum.kirupa.com/t/mx-pls-help-correct-this-code/13936/20 "2003-02-20T05:36:16Z")

</div>

WHOOHOOO… i was altering that last coding you gave me and came up with :

* * *

onMouseDown = function() {  
createEmptyMovieClip (“holder”, 8)  
holder.loadMovie (“boxopener.swf”)  
this.onEnterFrame = function () {  
if (holder.getBytesLoaded() == holder.getBytesTotal()) {  
holder.\_x = 400  
holder.\_y = 70  
}  
}  
}

* * *

which works!! Oh YEA!! That’s what we like to see. Now as the final touch (if possible) can I change the cursor look to an arrow or something so ppl can easily tell they are suppose to click on the wording??

P.s. Kax … you are amazing and you can’t believe how grateful i am for all of your help!!

:love: ~ S.Blaze

[Next page](https://forum.kirupa.com/t/mx-pls-help-correct-this-code/13936.md?page=2)
