Solved

Why a _root function never receives a parameter ?

Posted on 2009-06-30
4
367 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Here are some practices and techniques that can be adopted into your Flash/Flex application development process. Note: Not all "performance tips" provide an immediately-recognizable benefit.   This article does not include timing validation data,…
I have found that much of my time doing support ends up being a constant repetition of the same steps to different people.  Early on I stated using web pages with Frequently Asked Questions (FAQs) to alleviate most of the burden.  Sometimes this jus…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.

863 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now