Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 01-11-2006, 05:03 PM   #1
silverbitz
Flash Chick
 
silverbitz's Avatar
 
Join Date: Jun 2005
Location: Montreal, PQ
Posts: 50
Default Pop up window & Load text

Heyas!

I just switched from FlashMX to Flash8 and I'm having some trouble figuring out some stuff that has changed. I have a file that I'm trying to update, that I originally did with FlashMX and that I'm working on now with Flash8.

Here's my 1st problem:

My java-script pop-up window thing doesn't work anymore, when I try it my browser gives me a window saying that my Flash Player has aborded an unsafe operation.

Here's my original code that used to work with my old Flash player:

Code:
on (press) {
	getURL ("javascript:openWin('img9','Photo','bio/kat_kick.jpg','500','544');");
		
}
Is there a new way to put that?

My 2nd problem.. My loading text from a .txt file doesn't work anymore, Flash tells me that:

Code:
**Warning** Symbol=content news, layer=Layer 1, frame=10:Line 4: The identifier 'loadVars' will not resolve to built-in object 'LoadVars' at runtime.
     loadText = new loadVars();

**Warning** Symbol=content_portfolio, layer=Layer 2, frame=10:Line 3: The identifier 'loadVars' will not resolve to built-in object 'LoadVars' at runtime.
     loadText = new loadVars();

Total ActionScript Errors: 2 	 Reported Errors: 2
I guess the problem is with the loadVars(); command.. but I don't know what to change it to. My code is:

Code:
loadText = new loadVars();
loadText.load("texts/news.txt");
//creating the loadVarsText function
loadText.onLoad = function() {
	

for (i=0; i<10; i++) {
	
	
	newstext.htmlText += +this["date"+i]+"<br>"+"<br>"+this["text"+i];
	
}
}
Any help would be greatly appreciated
silverbitz is offline   Reply With Quote
Old 01-11-2006, 06:15 PM   #2
Scottae
Supa Flasha
 
Scottae's Avatar
 
Join Date: May 2004
Location: Atlanta, GA
Posts: 504
Exclamation

Quote:
Originally Posted by silverbitz
My java-script pop-up window thing doesn't work anymore, when I try it my browser gives me a window saying that my Flash Player has aborded an unsafe operation.
It looks like you are not specifying correct parameters for the window.open method. That's probably part of your problem. Check out How to create pop-up browser windows in Flash (getURL:javascript). Also check out A comprehensive list of supported Macromedia Flash features, specific to each browser

Quote:
Originally Posted by silverbitz
Is there a new way to put that?
Instead of having a defined JavaScript method on the html, you could just call the window.open method directly like this:

ActionScript Code:
// One way getURL ("javascript:window.open('bio/kat_kick.jpg','Photo','width=500,height=544');void(0);"); // Another way getURL ("javascript:void window.open('bio/kat_kick.jpg','Photo','width=500,height=544');");


Quote:
Originally Posted by silverbitz
My 2nd problem.. My loading text from a .txt file doesn't work anymore, Flash tells me that:

Code:
**Warning** Symbol=content news, layer=Layer 1, frame=10:Line 4: The identifier 'loadVars' will not resolve to built-in object 'LoadVars' at runtime.
     loadText = new loadVars();

**Warning** Symbol=content_portfolio, layer=Layer 2, frame=10:Line 3: The identifier 'loadVars' will not resolve to built-in object 'LoadVars' at runtime.
     loadText = new loadVars();

Total ActionScript Errors: 2 	 Reported Errors: 2
Flash is case sensitive now (since Flash MX 2004). You have to use an upper case L (LoadVars)

Last edited by Scottae; 01-11-2006 at 06:17 PM.
Scottae is offline   Reply With Quote
Old 01-11-2006, 07:05 PM   #3
Scottae
Supa Flasha
 
Scottae's Avatar
 
Join Date: May 2004
Location: Atlanta, GA
Posts: 504
Lightbulb Oh yeah

You can also use the ExternalInterface class which is new to Flash 8.
Scottae is offline   Reply With Quote
Old 01-14-2006, 05:28 PM   #4
silverbitz
Flash Chick
 
silverbitz's Avatar
 
Join Date: Jun 2005
Location: Montreal, PQ
Posts: 50
Default

thank you so much!!! the text loads in, i didnt know Flash was now case sensitive..

i'm having another problem though, i had a menu working just fine with FlashMX but it's kind of dead now

Maybe someone can tell me what's wrong with it. It might something stupid with capital letters again, but I have no clue...

Code:
dedans1.loadMovie ("gallery-0.swf", 1);
loadText = new LoadVars();
loadText.load("texts/portfolio.txt");

loadText.onLoad = function() {
		

_root.content_portfolio.createEmptyMovieClip("Button_Menu", 1);
_root.content_portfolio.Button_Menu._x = 0;
_root.content_portfolio.Button_Menu._y = 85;
button_Amount = 6;

for (i=0; i<button_Amount; i++) {

///////////////MENU
	
_root.content_portfolio.Button_Menu.attachMovie("button_mc", "Button_No"+i, i+1);
	var currentButton = _root.content_portfolio.Button_Menu["Button_No"+i];
	currentButton._x = i*120;
	currentButton.button_Id = i;
	currentButton.num = i;
	currentButton.button_Text.text = this["cat"+i];
	currentButton.onPress = function() {
				
	dedans1.loadMovie ("gallery-"+this.num+".swf", 1);
	
	}

///////////////ROLL OVERS
		
currentButton.onRollOver = function() {
			this.gotoAndStop("over_state");
			
		};
		currentButton.onRollOut = function() {
			if (this.button_Id != currentlyDown) {
				this.gotoAndStop("up_state");
			} else {
				this.gotoAndStop("down_state");
			}
		};

	/////////////// NO REPEAT
	
	currentlyDown = 0
					_root.content_portfolio.Button_Menu.onEnterFrame = function () {
     if (currentlyDown != null && _root.content_portfolio.Button_Menu["Button_No"+currentlyDown]._currentframe != "down_state") {
          //checks if a button was pressed and if that button is in the down state
          _root.content_portfolio.Button_Menu["Button_No"+currentlyDown].gotoAndPlay("down_state");
          //if that's not the case, set the right button in the down state
     }
	 }
	
	///////////////ON RELEASE
	
	currentButton.onRelease = function() {
				
	
		this.gotoAndStop("down_state");

		if (this.button_Id != currentlyDown && currentlyDown != null) {
			_root.content_portfolio.Button_Menu["Button_No"+currentlyDown].gotoAndStop("up_state");
			message_Window += " Button no. "+currentlyDown+" is no longer selected.";
		}
		currentlyDown = this.button_Id;
	};
	
	}

};
silverbitz is offline   Reply With Quote
Old 01-14-2006, 05:31 PM   #5
Scottae
Supa Flasha
 
Scottae's Avatar
 
Join Date: May 2004
Location: Atlanta, GA
Posts: 504
Default

I don't know either......what errors are you getting?
Scottae is offline   Reply With Quote
Old 01-15-2006, 05:13 PM   #6
silverbitz
Flash Chick
 
silverbitz's Avatar
 
Join Date: Jun 2005
Location: Montreal, PQ
Posts: 50
Default

I don't get any error message (so yeah, i guess it's not a spelling thing). But my buttons don't work anymore.

This code used to generate buttons with text from a text file. By clicking on those buttons I could load an external clip into my animation. Actually you could see it working online:

http://silverfragments.com/

If you click on portfolio, you see the sections (design, websites, drawings, etc.): those are the buttons. When I open that same file with Flash8, that menu doesn't work anymore.
silverbitz is offline   Reply With Quote
Old 01-15-2006, 05:32 PM   #7
flashead
daehsalf
 
Join Date: Feb 2005
Location: Toronto, ON
Posts: 1,420
Default

Is it just the buttons that don't work, or does it not even build the menu?


EDIT:

I got this error:
Type mismatch in assignment statement: found Number where String is required.
for (i=0; i<button_Amount; i++) {


I'm not sure why I got it, I don't understand why it would be expecting a String.
But it was fine after I changed that line to:
ActionScript Code:
for (var i=0; i<button_Amount; i++) {

Last edited by flashead; 01-15-2006 at 05:48 PM.
flashead is offline   Reply With Quote
Old 01-16-2006, 02:06 PM   #8
Scottae
Supa Flasha
 
Scottae's Avatar
 
Join Date: May 2004
Location: Atlanta, GA
Posts: 504
Exclamation

The menu is working for me. I have Flash player 8.5
Scottae is offline   Reply With Quote
Old 02-17-2006, 08:27 PM   #9
silverbitz
Flash Chick
 
silverbitz's Avatar
 
Join Date: Jun 2005
Location: Montreal, PQ
Posts: 50
Default

OMG it works! I just added the "var" as you did and it works!! ^^

thanks a lot!

EDIT: Actually, it only works when i look at the swf file by itself.. when i look at the whole thing inside my html page, the menu doesn't work still! I mean, the buttons appear as they should, the only thing that doesn't work is the onPress command: no clips are loaded as they should! Although they work in the swf file.. how can that be? I checked like a thousand times to make sure that i was loading the correct swf file into my html page.. o.O

Last edited by silverbitz; 02-17-2006 at 08:51 PM.
silverbitz is offline   Reply With Quote
Old 02-18-2006, 05:21 PM   #10
Scottae
Supa Flasha
 
Scottae's Avatar
 
Join Date: May 2004
Location: Atlanta, GA
Posts: 504
Lightbulb

Try checking out these links....

Setting publish options for the Flash SWF file format
About publishing secure Flash documents
Other improvements
Scottae is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Pop up window - make links load in '_parent' (help!) humbleches ActionScript 1.0 (and below) 2 02-03-2005 12:02 AM
Load Text Problem crabby80 ActionScript 2.0 0 01-19-2005 04:33 PM
PLEASE HELP: using html tags 2 load image into text file sineadhartley ActionScript 2.0 11 05-15-2004 12:56 PM
load text into array from text file in flash5 kavita18 ActionScript 1.0 (and below) 2 11-04-2003 06:42 AM
slow load of external text file sreebar Simple Stuff (Newbies) 4 04-01-2002 07:10 PM


All times are GMT. The time now is 02:49 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.