---
title: "with fel"
type: "forum-thread"
url: "https://www.webforum.nu/amne/flash/132537-with-fel"
topic: "Flash"
topic_url: "https://www.webforum.nu/amne/flash"
author: "M@rtin"
published: "2005-08-10T12:22:59.000Z"
updated: "2005-08-10T13:33:02.000Z"
replies: 2
views: 237
page: 1
pages: 1
language: "sv-SE"
site: "webForum — webforum.nu"
rights: "Upphovsrätten till varje inlägg tillhör dess författare."
attribution: "Citera som: webForum, https://www.webforum.nu/amne/flash/132537-with-fel"
---

# with fel

## #1 — M@rtin, 2005-08-10T12:22Z

Har ett helt tomt flashdokument och endast denna kod:

```
_root.createEmptyMovieClip ("myMovie1", 1);
with (_root.myMovie1){
	lineStyle (1, 0x000000, 100);
	moveTo (0, 0);
	for(i=0;i<120;i++){
		for(j=0;j<80;j++){
			lineStyle (1, 0x000000, 100);
			lineTo(i,j);
		}
	}
	_rotation = 90;
}

duplicateMovie(_root.myMovie1,"myMovie2",2);

with(_root.myMovie2){
	_x=200;
	_y=200;
	moveTo(0,0)
	lineStyle (1, 0x000000, 100);
	lineTo(20,30);
}
```

Får felet:
Error: A 'with' action failed because the specified object did not exist.

Troligen på den andra with-satsen för den första fungerar separat. Även om jag struntar i with och skriver ut hela får inte koden önskad effekt.

Säkert något enkelt fel men jag har tokletat efter stavfel eller reserverade ord utan att hitta något. Någon som ser vad som är fel?

Permalänk: https://www.webforum.nu/p/132537

## #2 — mirandir, 2005-08-10T13:26Z

"duplicateMovie" skall vara "duplicateMovieClip"

/Mirandir

Permalänk: https://www.webforum.nu/p/1655551

## #3 — M@rtin, 2005-08-10T13:33Z

Ah! Fungerade perfekt. Tusen tack!

Permalänk: https://www.webforum.nu/p/1655554

---

Tråden på webben: https://www.webforum.nu/amne/flash/132537-with-fel
