01-11-2006, 05:03 PM
|
#1
|
|
Flash Chick
Join Date: Jun 2005
Location: Montreal, PQ
Posts: 50
|
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
|
|
|
01-11-2006, 06:15 PM
|
#2
|
|
Supa Flasha
Join Date: May 2004
Location: Atlanta, GA
Posts: 504
|
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.
|
|
|
01-11-2006, 07:05 PM
|
#3
|
|
Supa Flasha
Join Date: May 2004
Location: Atlanta, GA
Posts: 504
|
Oh yeah
You can also use the ExternalInterface class which is new to Flash 8.
|
|
|
01-14-2006, 05:28 PM
|
#4
|
|
Flash Chick
Join Date: Jun 2005
Location: Montreal, PQ
Posts: 50
|
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;
};
}
};
|
|
|
01-14-2006, 05:31 PM
|
#5
|
|
Supa Flasha
Join Date: May 2004
Location: Atlanta, GA
Posts: 504
|
I don't know either......what errors are you getting?
|
|
|
01-15-2006, 05:13 PM
|
#6
|
|
Flash Chick
Join Date: Jun 2005
Location: Montreal, PQ
Posts: 50
|
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.
|
|
|
01-15-2006, 05:32 PM
|
#7
|
|
daehsalf
Join Date: Feb 2005
Location: Toronto, ON
Posts: 1,420
|
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.
|
|
|
01-16-2006, 02:06 PM
|
#8
|
|
Supa Flasha
Join Date: May 2004
Location: Atlanta, GA
Posts: 504
|
The menu is working for me. I have Flash player 8.5
|
|
|
02-17-2006, 08:27 PM
|
#9
|
|
Flash Chick
Join Date: Jun 2005
Location: Montreal, PQ
Posts: 50
|
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.
|
|
|
02-18-2006, 05:21 PM
|
#10
|
|
Supa Flasha
Join Date: May 2004
Location: Atlanta, GA
Posts: 504
|
|
|
|
| Thread Tools |
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT. The time now is 06:02 AM.
///
|
|