Solved

Why a _root function never receives a parameter ?

Posted on 2009-06-30
4
369 Views
Last Modified: 2013-11-11
HI

I am using a function in the _root scene and it is called from a movie clip inside of it, but at the moment of getting the value of the parameter it appears undefined.

Thanks in advance.
// Function at the _root scene
function ControlaMapa (estado:String){
trace(estado);
	switch (estado) { 
	 case "Merida" : 
		//Activa los datos del distribuidor
		_root.Mexico.dYucatan.play(2);
		//Desactiva el resto de los estados del mapa
		_root.Mexico.Jalisco.gotoAndStop(1);
		_root.Mexico.Michoacan.gotoAndStop(1);
		_root.Mexico.Nayarit.gotoAndStop(1);
		_root.Mexico.NuevoLeon.gotoAndStop(1);
		_root.Mexico.Tamaulipas.gotoAndStop(1);
	 break;
	
	}
}
 
 
// Function call from a movie clip inside main scene
on (release)
{
	//Controla el aspecto del resto del mapa
	_root.ControlaMapa('Merida');
	//Activa el presente estado
	this.play();
}

Open in new window

0
Comment
Question by:dimensionav
  • 2
  • 2
4 Comments
 

Author Comment

by:dimensionav
ID: 24749375
If I avoid typing the parameter everything works perfect, just like this:

function ControlaMapa (estado:){
// some instructions
.
.
}

The strong type syntax is ok, isn´t it ?

Thanks.
0
 
LVL 18

Expert Comment

by:Antonio Estrada
ID: 24757618
I guess there's something wrong with your *.fla file, would you mind uploading it to take a look?

('cause yes, strong typing is allowed and actually, recommended)

-V
0
 

Author Comment

by:dimensionav
ID: 24757838
Please change the file extension .TXT for .FLA

Regards
mapaV3.txt
0
 
LVL 18

Accepted Solution

by:
Antonio Estrada earned 500 total points
ID: 24759097
Ok, I found out your issue.

You were exporting as ActionScript 1.0 (which doesn't allow strong types), so in order to fix it, all I did was to go to the File menu, then click on Publish Settings, on the window I selected the Flash tab, and on ActionScript version I switched it from ActionScript 1.0 to ActionScript 2.0.

With that, voilá, it works with strong typing :)

-V
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Where to download Acrobat flash offline installer? 2 251
blocked plugin flash 5 121
Adobe Flash Player won't install on Windows 7 3 259
Flash Player Action Script Error 1090 5 216
There are times in your Flash CS4 application when you want more than a simple pointer or a hand, and it's hard to find an ideal walk-through to tell you what to do.  I spent a few days recently learning my way around making custom cursors in Flash,…
This article describes a solution to a problem of subloading one movie into another when they have different SWF versions. Sometime back, I was working on an ActionScript project while I came across an interesting fact which I would like to share…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question