---
title: "Variabel?"
type: "forum-thread"
url: "https://www.webforum.nu/amne/flash/103618-variabel"
topic: "Flash"
topic_url: "https://www.webforum.nu/amne/flash"
author: "Pontus Thor"
published: "2004-05-14T09:59:04.000Z"
updated: "2004-05-14T10:27:47.000Z"
replies: 1
views: 243
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/103618-variabel"
---

# Variabel?

## #1 — Pontus Thor, 2004-05-14T09:59Z

Jag har en symbol som innehåller:

> onClipEvent(load){
> 	xspeed = -5+int((random(100)+1));
> 	yspeed = -5+int((random(100)+1));
> 	spotX = xspeed \*10
> 	spotY = yspeed \*10
> }
> onClipEvent(enterFrame){
> 	counter += 1
> 	this.\_x += xspeed;
> 	this.\_y += yspeed;
> 	if(counter \>9){
> 		xspeed = -5+int((random(10)+1));
> 		yspeed= -5+int((random(10)+1));
> 		counter = 0;
> 	}
> 	if (this.\_x \> 550){
> 		this.\_x = 0;
> 	}
> 	if (this.\_x \< 0){
> 		this.\_x = 550;
> 	}
> 	if (this.\_y \> 400){
> 		this.\_y = 0;
> 	}
> 	if (this.\_y \< 0){
> 		this.\_y = 400;
> 	}
> }
> 
> on(press){
> 	\_root.n++;
> 	bn = "org" + \_root.n;
> 	duplicateMovieClip(\_root.org,bn,\_root.n);
> /\*
> 	var \_root.winner;
> 	\_root.winner++;
> 	
> 	if(\_root.winner \> 10){
> 	gotoAndPlay("Scene 1", 2);
> 	}
> \*/
> }

 

via det bortkomenterade försöker jag ändra så att man kommer till bildruta 2 när man dublicerat symbolen 10 gånger. Men jag får ddet inte att funka(är nybörjare :) ). Någon?

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

## #2 — mirandir, 2004-05-14T10:27Z

```
if(_root.winner > 10){
    [B]_root.[/B]gotoAndPlay([B]2[/B]);
}
```

/Mirandir

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

---

Tråden på webben: https://www.webforum.nu/amne/flash/103618-variabel
