Checking If File Exists? Works Fine In IE
so, what Im trying to do is search for xml files that are labelled by number (1.xml,2.xml,3.xml etc) and stop at the highest one. as you can see Ive put this in a function that starts at 10 and decrements each time it loads, each time testing if the file exists (starting at 10.xml).
now this seems to work all well and good in Internet Explorer and Flash, but for some reason in Firefox it falls over (and possibly other browsers?).
anyone know what could be causing this? or any way I could resolve the situation.
any help would be greatly (greatly!) appreciated
Code:
var ticktock = 10;
function findAvail(ticktock){ myVars = new LoadVars(); _root["ticktock"]--;
myVars.onLoad = function(success){ if(success){
_root["found1"].text = "found"; //trace("File loaded ..." +_root["ticktock"]+ ".xml"); }else{ //trace("File not found!" +_root["ticktock"]+ ".xml"); findAvail(_root["ticktock"]); } } //search for xml using counter myVars.load(_root["ticktock"]+".xml");
}
findAvail(ticktock);
I've attached an example if you want to test yourself.
DevShed > Flash Help
Posted on: August 6th, 2005, 07:07 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
- Checking If File Exists? Works Fine In IE
- Checking To See If A File Exists
- Help- Checking If File Exists?
- Checking If A File Exists
- [AS1] Checking A File Exists?
- Checking If A File Exists
- Checking If A File Exists
- Checking If File Exists
- Checking If A File Exists
- Checking If A File Exists
- Checking If A JPG File Exists In A Folder
- Checking If An External Sound File Exists
- Checking If File Exists / Change Width & Height
- Problem With .projector File(.swf Works Fine)
- File Works Fine Local - But Not On The Server
- Problem With .projector File(.swf Works Fine)
- Auto Playing Of First Media File Works Fine, But All Others
- Checking To See If Variable Exists
- Checking If Swf Exists In Directory
- Checking If A Variable Exists
- Checking If Array Exists
- Checking To See If A Clip Exists
- Checking To See If A Movieclip Exists
- Checking To See If A Movieclip Exists
- Checking If Movie Clip Exists
- Checking If A Symbol Exists In The Library
- Checking Array To See If Variable Exists Before Adding
- [F8] Works Fine In PC (IE And FF) But Not In Mac...
- .swf Works Fine On PC, Not On Mac...
- Works Fine - But Not When Publish
- Preloader Works Fine But Not On IE
- Works Fine @ Home, But Not On The Net.
- My SWF Works Fine With Firefox, Not With IE...
- SWF Works Fine...HTML Does Not
- Works Fine Firefox Not IE
- Works Fine In Actionscript 1 But Not 2?
- Getting Variables Works Fine But...
- LoadMovie Help Anyone? Works Fine On PC, But Not Online
- Mask Works Fine In Editor, Not In Swf
- Loadmovie Works Fine Until I Upload...
- Navigation Works Fine When Viewed On PC But Not On Mac, Why?
- [CS3][A2] Gallery Works Fine In IE, But Not In FF And Opera
- My First Button Bar, Almost Works, Just Needs Some Fine Tuning
- LoadmovieNum Works Fine On Harddisk But Not On The Web
- .swf Works Fine On My Machine.. But Not Once Uploaded
- *The Flash Mx Form With Php Works Fine But,..
- Improving The Xml Gallery(actually Works Fine)
- Terrible Issues With AS3. AS2 Works Fine.
- MC Won't Work In Timeline - Works Fine On It's Own
Checking If File Exists? Works Fine In IE
so, what Im trying to do is search for xml files that are labelled by number (1.xml,2.xml,3.xml etc) and stop at the highest one. as you can see Ive put this in a function that starts at 10 and decrements each time it loads, each time testing if the file exists (starting at 10.xml).
now this seems to work all well and good in Internet Explorer (and Flash!) but for some reason in Firefox it falls over.
anyone know what could be causing this? or any way I could resolve the situation.
any help would be greatly appreciated
Code:
var ticktock = 10;
function findAvail(ticktock){
myVars = new LoadVars();
_root["ticktock"]--;
myVars.onLoad = function(success){
if(success){
_root["found1"].text = "found";
//trace("File loaded ..." +_root["ticktock"]+ ".xml");
}else{
//trace("File not found!" +_root["ticktock"]+ ".xml");
findAvail(_root["ticktock"]);
}
}
//search for xml using counter
myVars.load(_root["ticktock"]+".xml");
}
findAvail(ticktock);
I've attached an example if you want to test yourself.
Checking To See If A File Exists
I'm working on a system that will let me load an swf file while I'm within another swf file. I have it so it loads fine, but I'm trying to foolproof this. I don't have anything set up to deal with typos. How do I check and see if a file exists before Flash tries to load it?
DemonKilla
http://www.DemonKilla.com
Help- Checking If File Exists?
Hi all
Is there an equivalent to PHP's if(file_exists) command? That is, checking whether a text file exists or not.
Also, when Flash calls a text file with only the file specified (e.g. "file.txt"), does it look in the folder where the swf is stored, or in the folder where the current page is? I've always wondered that.
Checking If A File Exists
Ok, i need to check if a file exists in flash and flash only (as opposed to external files)
this is what i have so far, i got it from another website but it isn't very accurate.
Quote:
myVars = new LoadVars();
myVars.onLoad = function(success) {
if (success) {
_root.error.gotoAndStop("exists");
} else {
_root.check++;
}
};
myVars.Load("members/"+_root.name+".txt", myVars, "POST");
i need another way of determining if a file exists. I'm sorry, i can't explain it to well without showing you the .fla file, but i can't show u the .fla file either because it's something very private, if you need me to specify anything else anymore please post it, thanks for your help guys,
-rishi
[AS1] Checking A File Exists?
I've spent 2 nights at least searching the net for things like "actionscript 1 check file exists" and so on, and the best I find is people saying to check if a file exists, do this
Code:
fileExists=new LoadVars();
fileExits._parent=this;
fileExists.onLoad=function(success)
{
//success is true if the file exists, false if it doesnt
if(success)
{
//the file exists
var nm=this._parent.createEmptyMovieClip("swfHolder",1); //so create a movieclip
nm.loadMovie("myfile.swf"); //and load our .swf file into it
}
}
fileExists.load("myfile.swf") //initiate the test
Pretty much anything online saying how to check files uses this exact example.
The problem is while that may itself work, the action on success is fixed - I can't put all that in for every image load, and I can't make it into any kind of function - I've tried - the function will always return false when called because the image doesn't load until later.
The image doesn't finish loading until after the call is made and execution has carried on, so I see no way to know when you're checking if it exists without waiting around somehow for the image to load and then get a reply, but if it doesn't load then how would you know? Gah x_x
And I can't pass the function what to do when it loads etc because it will be varied. So yeah I've tried all sorts. The code I'm really trying to come up with would make something like this possible
Code:
If (DoesFileExist(filename)) { ShowImage(clip,filename); }
Else { clip.attachMovieClip("libitem","libitem",1); }
or maybe
Code:
var didItWork = ShowImage(clip,filename);
if (!didItWork) { clip.attachMovieClip("libitem","libitem",1); }
Do you see what I mean?
That way I can simply load images if they're there and if not I can load a library item that is a 'image not found' symbol. But frankly I can't for the life of me do it -_-
I'm severely tempted to use PHP to just check and return the result but I don't want to require PHP just for that and I think I'd have similar problems waiting around for the reply
Checking If A File Exists
Im writing a slideshow program and I get an error when I try to load an image that doesnt exist. I did a lot of searching and cant find a way to check if an image file exists or not. Anyone have experience with this?
Thanks
Checking If A File Exists
Hey all,
I was wondering if there is a simple way to check if a file of a certain type (specifically, FLV) exists within a folder, using AS3. What I want to do is something along these lines...
Code:
if(there is a .flv file in the folder specified){
//Do something
}
Any help would be much appreciated. Thanks in advance!
tbeanz
Checking If A File Exists
Just a short question ...
How would you check if a file on a server exists and if not, check XX Times l8er again til ya find it and then go ahead with the script ...
any suggestions???
thanx in advance
Checking If A File Exists
does anyone know why this code would work when i test in in flash mx 04, but when i export my movie clip it stops working.
this code attempts to load a variable from an external text file. it first checks to see if the file exists, if it can't find it, it moves up a directory then checks again. again, this works perfectly in flash but when i export it and test it on my server it stops working. it will still find the file stored in the same directory, but if i delete that file it will not move directories.
ActionScript Code:
var strFileName = "pagetitle.txt";
fileExists = new LoadVars();
fileExists._parent = this;
fileExists.onLoad = function(success) {
if (success) {
//trace("Success: " + strFileName);
_root.loadVariables(strFileName);
} else {
//trace("Adding dots!");
strFileName = "../"+strFileName;
//trace(strFileName);
this.load(strFileName);
}
};
fileExists.load(strFileName);
//load
Checking If A JPG File Exists In A Folder
Hi all,
I'm in a panic and would need help, else - I dunno know what I will do, change jobs
I have this structure:
>banner (folder) --> banner.swf
>content (folder)
-->school (folder) -->images(folder with images)
----->program (folder) -->images(folder with images)
--------->course(folder) -->images(folder with images)
I would like this functionality:
The banner.swf file loads the images in the images folder in this sequesnce.
If there is an image in the course level, load those images else,
if there is an image in the program level, load those images else,
if there is an image in the school level, load those images.
Here is the code that is currently attached to my swf file.
function loadImage(){
banners = 13.; //number of jpg
directory = "../../../media/Banner_images/"; //the folder that jpgs are kept
//load a random jpg and set its alpha to 0
loadMovie(directory + Math.ceil(Math.random()*banners) + ".jpg",_root.loader);
fade = 0;
setProperty(this.loader, _alpha, fade);
//fade in the jpg
this.onEnterFrame = function () {
fade = fade+2;
setProperty(this.loader, _alpha, fade);
if(fade==100){
//run pause function when jpg is fully visible
pauseImage();
}
}
}
loadImage();
function pauseImage(){
startPause = setInterval(endPause, 50000);
function endPause() {
//remove startPause
clearInterval(startPause);
//once pause is over fade out the image
fadeImage();
}
}
function fadeImage(){
this.onEnterFrame = function () {
fade = fade-2;
setProperty(this.loader, _alpha, fade);
if(fade==0){
loadImage();
}
}
}
So basically, I just want to make the directory variable to be dynamic and change depending on the circumstances of image availability.
Thank you so much, would really appreciate all your help.
Best regards,
Michael
Checking If An External Sound File Exists
Is there any way to check if an external sound file exists? I've searched the net and found stuff on checking if files exist using LoadVars. But it doesnt work for sound.
Thanks,
Brendan Smith
Checking If File Exists / Change Width & Height
Hi,
I'm trying to return the width of a dynamically placed image. I've created a holder, but for some reason when I do a trace(holder._width); it just returns 0. Here is the script I am using - it checks to see if a file exists then loads the next image when the user pushes the next_btn. If the file doen't exist, nothing happens. My problem now is changing the registration point and setting its size, but I can't seem to return the width of the movie clip. Perhaps it has something to do with the holder path. Thanks in advance for your help.
code:
var fileExists:LoadVars = new LoadVars();
fileExists._parent = this;
fileExists.onLoad = function(success){
if(success){
var slides:MovieClip = this._parent.createEmptyMovieClip("slides_mc",1);
var holder = this._parent.slides_mc.createEmptyMovieClip("holde r_mc",1);
holder.loadMovie(person + "/" + folder + "/" + "image" + imagenum + ".jpg");
holder._x = regpoint_mc._x;
holder._y = regpoint_mc._y;
trace (holder._width);
}else{
imagenum--;
}
}
fileExists.load(person + "/" + folder + "/" + "image" + imagenum + ".jpg");
next_btn.onRelease = function (){
imagenum++;
fileExists.load(person + "/" + folder + "/" + "image" + imagenum + ".jpg");
}
Problem With .projector File(.swf Works Fine)
I have a movie where text is loaded in from external file like this:
loadVariables("kysimused/kysimused1.txt", vastus_d);
loadVariablesNum("kysimused/kysimused1.txt", 2);
All works fine when I'm using flash player, but when im making .exe file. It won't load the texts. Any idea why?
File Works Fine Local - But Not On The Server
Hi. I have made a flash video using and flv and the playback component.
It works great local. But, when online does nothing.
In the debug it say that it can't find the file!
But, the file is defo there.
This is the location of the file:
http://www.quanticsolutions.co.uk/temp/test.flv
It just comes up with file not found. I have made a copy of the file and changed the extension to zip and the file downloads (http://www.quanticsolutions.co.uk/temp/test.zip). The flv is defo there though!
From inside flash, if I set the component to use the flv at
http://www.quanticsolutions.co.uk/temp/test.flv it says
"Failed to load http://www.quanticsolutions.co.uk/temp/test.flv"
I don't understand - the file is there, I have no firewalls. Is it maybe some configuration in IIS that I am unware of?
Please advise.
M@)
Problem With .projector File(.swf Works Fine)
I have a movie where text is loaded in from external file like this:
loadVariables("kysimused/kysimused1.txt", vastus_d);
loadVariablesNum("kysimused/kysimused1.txt", 2);
All works fine when I'm using flash player, but when im making .exe file. It won't load the texts. Any idea why?
Auto Playing Of First Media File Works Fine, But All Others
Good morning Flash maniacs.
I have been on a flash media application that reads from an XML file retrieves external files and media files and starts to play them automatically. This is fine. The problem occurs when the user clicks to load another media file which in turn parses over a new XML file and retrieves external and media files (this works fine) but the auto playing of the files is not working correctly.
What is occuring is this.
1. Using trace statements I have verified that all of the external files that are required are loaded.
2. Loading of the audio/media file is loaded
3. Check to see if the audio file is playing via the mediaPlayer.playing which returns true
4. Checking of the playhead position is always 0 (checking this with an interval method)
5. No sound is playing at all, playhead is not moving but the app says it is playing.
Now, if I click on the pause button and then click on the play button it starts playing just fine.
What could be the issue that the media player says its playing, but is not actually playing because the playhead is never progressing?
Thanks for looking.
Checking To See If Variable Exists
this seems like the easiest thing in the world, but i'm having problems with checking to see if a variable exists... so i'll break down what i've already done to try to get to the heart of the matter.
here's the script that's not working:
var1="test";
if (var1) {
trace ("true");
}
why is this not working....?
Checking If Swf Exists In Directory
Say I load an swf from another to be placed on a higher level. If the file does'nt exist then nothing happens and the user is left wondering why.
Is it possible to check if the file exists,and if not post an error? Similar to a bad html link.
Checking If A Variable Exists
Hi folks,
I'm passing a query string into flash and sometimes the name value pair simply won't exist in the query string. I would like to check to see of the variable that flash is expecting is set or not.
how do you check to see if the value is set?
Cheers.
Mark
Checking If Array Exists
hi,
iwant somthing like this, but am unsure of how to tell if an array exists?
var kill = fighterlist.lenght
if (kill array has not been made then){
fighterlist=[]
fighterlist.push(kill+1)
}
else if? (if it has been made){
fighterlist.push(kill+1)
}
Checking To See If A Clip Exists
hey.
How do I check if something exists.
for instance
for (n=1; n<12; n++) {
if (_parent['text'+n] == true){
trace (n)
}
}
i don't know if i'm on the right track. Basically i need to nest a couple of 'for' statements inside other 'for' statements but i only want to the code to work if the intended clip actually exists. Can anyone help me with this.
Thanx a lot
Checking To See If A Movieclip Exists
I have a series of swfs that I am loading externally. Some swfs have a movie clip named 'DownloadMC'. I am trying to check if the movie clip exists, but I keep getting an error.
Code:
var theMC= MyLoadedMC.getChildAt(timesLoadCalled);// theMC is a loader object so use MovieClip(theMC.content)
trace('it exsists because here is the name: '+MovieClip(theMC.content).DownloadMC.name);//traces 'DownloadMC'
if(MovieClip(theMC.content).getChildByName('DownloadMC') != null){ var CallTopic:Sprite = new Sprite();
CallTopic.name = "CallTopic";
CallTopic.graphics.beginFill(0xFF2200,1);
CallTopic.graphics.drawRect(MovieClip(theMC.content).DownloadMC.x, MovieClip(theMC.content).DownloadMC.y, MovieClip(theMC.content).DownloadMC.width,MovieClip(theMC.content).DownloadMC.height);
MovieClip(theMC.content).addChild(CallTopic);
}
the code above gives me an error in the output:
Code:
TypeError: Error #1010: A term is undefined and has no properties.
at MethodInfo-464()
I hope this can be done,
thanks
Aubrey
Checking To See If A Movieclip Exists
I have a series of swfs that I am loading externally. Some have a movie clip named 'DownloadMC'. I am trying to check if the movie clip exists, but I keep getting an error.
Code:
var CallTopic:Sprite = new Sprite();
if(MovieClip(theMC.content).getChildByName('DownloadMC')){
CallTopic.name = "CallTopic";
CallTopic.graphics.beginFill(0xFF2200,1);
CallTopic.graphics.drawRect(MovieClip(theMC.content).DownloadMC.x, MovieClip(theMC.content).DownloadMC.y, MovieClip(theMC.content).DownloadMC.width,MovieClip(theMC.content).DownloadMC.height);
MovieClip(theMC.content).addChild(CallTopic);
}
the code above gives me an error in the output:
Code:
TypeError: Error #1010: A term is undefined and has no properties.
at MethodInfo-464()
not sure what the problem is?
aubrey
Checking If A Symbol Exists In The Library
Hi
My situation is thus: I have an XML file with entries, each of which contains a handle (linkage ID) to the movie clip that represents that entry onstage.
So I dynamically load these symbols in from the library accordingly. Only problem is, I need to be able to count how many of those entries are valid, that is, how many of the XML entries have handles that actually do correctly correspond to the names of the symbols in the library.
So right now in order to count the entries I am using the value of how many entries were in the XML file but this is wrong, I need a value of how many entries in the XML correspond correctly to a library symbol.
As it stands now, if all the names in the XML file match those in the .fla, all is good. Otherwise, issues. The thing is, I want this setup to be robust so the program takes responsibility and resolves issues if there are errors in the XML.
Now, the only way I can see to fixing this simply, is if there is a way to check if a symbol exists in the library -- without actually trying to load it.
That way I can count just those symbols from the XML file that also do exist in the library.
TIA,
-Nick
Checking Array To See If Variable Exists Before Adding
Hi all, this should be easy, but I can't get my head round it
What I want to do is check an array to see if the variable already exists in the array before adding it via push (if it does not already exist in the array).
Just a little example would be really helpful, cheers.
[F8] Works Fine In PC (IE And FF) But Not In Mac...
Hi,
I have made this application for a customer (it can be viewed at http://www.personalcoder.com/samples..._creator.html).
Basically it is a memory game editor, where you can upload, crop and rotate your own pictures. And, at the end you can save and play it.
The case is that currently we are at the latest bug fixes stage, and regardless the fact it works trully fine in Internet Explorer and Firefox on PC, my client just noticed that it is not working properly on Mac (he didnt tell me what browser).
He told me that when in a Mac, after to click the "upload photos" button, the preloader starts spinning, keep seated there forever and doesnt do anything after that.
I suspect that it may be gathering some bad PHP response from server (that I didnt handled) due to a file reference failure. The case is that I have not a Mac to test it, and I would like to hear some advices.
At first sight I think that there is not anything wrong with the application itself because it works fine on PC browsers, and my only guess is that may have a bug in the Mac browser plugin regarding to file reference that makes it fails when trying to handle uploads.
There is any known issue about Flash, Mac and file reference?
Any other idea?
Thanks!
.swf Works Fine On PC, Not On Mac...
Hi
I have a .swf file that is working on PC (Netscape, Firefox, IE). However it does not display correctly on MacOS10 (Safari, Netscape, or Firefox).
The problem: I have several masks. some of the masking does not appear at all on the Mac. Additionally,I have a gradient background below on the bottom layer that is not appaering at all, nor is my Flash background appearing, and thereby the rest of objects showing through to the DIV beneath.
Now, I need to set the following in the OBJECT tag so that my DHTML menu will appear above the Flash ...
CODE <param name="wmode" value="transparent" />
<embed src="" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="655" height="330" wmode="transparent" >
Works Fine - But Not When Publish
Hi "freaks" ha ha
I have this little problem (i think). I cant get my text to load when i load my new .swf into my 1st .swf. But the problem only comes on the NET and not when i ctrl + enter to roll my flash. (all files have been ftp's to server)
Heres the link and code on button. (when button i push some text comes besides or not!!!)
http://www.borisfoss.dk
on (rollOver) {
_level0.stop();
}
on (rollOut) {
_level0.play();
}
on (release) {
_level0.stop();
loadMovie("tekst1.swf", 1);
loadVariablesNum("Borisstart.txt", 1);
}
From Denmark
Tony.
Preloader Works Fine But Not On IE
im having a problem with internet explorer
showing the preloader but when but all works
fine when i publish the swf and "show streaming"
here is the code i am using:
onClipEvent (enterFrame) {
counter = math.floor(_parent.getBytesLoaded()/_parent.getBytesTotal()*100);
_parent.counterpercent = counter+"%";
if (counter>=100) {
_parent.play();
}
}
thanks for any help =)
Works Fine @ Home, But Not On The Net.
Could someone possible take the time to look at my code here?
It works fine at home, but on the web it doesnt work properly at all. I've allways sucked with preloaders and this is my first time with xml and flash gettting info from an xml doc.
What this should be is a small gallery swf, that loads all the pics listed in my xml doc and then displays them in thumbnail form.
There are 12 frames. al with action script on them. All frames except for the last contain a mc called loader which holds all the dynamic text fields. I know the code is dirty, but it was my first time with xml and flash.
Frame 1
Code:
loading = true;
to_load = new Array();
var pic_list = new XML();
pic_list.ignoreWhite = true;
pic_list.load("picture_loading.xml");
loader.amount.text = 0;
Frame2
Code:
pic_list.onLoad = function() {
//xml loader
loaded = pic_list.getBytesLoaded();
needed = pic_list.getBytesTotal();
loader.amount.text = (loaded/needed)*100;
if (loaded == needed) {
loader.xml.text = "done";
loading = false;
}
};
Frame3
Code:
if (loading == true) {
gotoAndPlay(2);
}
Frame4
Code:
loader.xml.text = "done";
loader.files.text = "working";
parent = pic_list.firstChild;
list = parent.childNodes;
i = 0;
Frame5
Code:
loader.xml.text = "done";
loader.files.text = "working";
to_load[i] = list[i].attributes.file;
trace("I:"+i);
amount = (i/(list.length-1))*100;
loader.amount.text = Math.round(amount);
Frame6
Code:
i++;
if (i != (list.length)) {
gotoAndPlay(5);
}
Frame7
Code:
loader.xml.text = "done";
loader.files.text = "done";
loader.pics.text = "working";
line = 1;
a = 0;
Frame8
Code:
trace(to_load[a]);
if (a == 5 || a == 10 || a == 15) {
line++;
}
_root.attachMovie("pic_holder", "pic_holder"+a, a);
_root["pic_holder"+a].loadMovie(to_load[a]);
if (line == 1) {
_root["pic_holder"+a]._x = (a*100)+(5*a);
}
if (line == 2) {
_root["pic_holder"+a]._x = ((a-5)*100)+(5*(a-5));
}
if (line == 3) {
_root["pic_holder"+a]._x = ((a-10)*100)+(5*(a-10));
}
if (line == 1) {
_root["pic_holder"+a]._y = 5;
}
if (line == 2) {
_root["pic_holder"+a]._y = 110;
}
if (line == 3) {
_root["pic_holder"+a]._y = 215;
}
Frame9
Code:
if (_root["pic_holder"+a].getBytesLoaded>=_root["pic_holder"+a].getBytesTotal) {
_root["pic_holder"+a]._visible = false;
loader.amount.text = a+"/"+to_load.length;
}
Frame10
Code:
if (_root["pic_holder"+a].getBytesLoaded>=_root["pic_holder"+a].getBytesTotal) {
_root["pic_holder"+a]._visible = false;
loader.amount.text = a+"/"+to_load.length;
a++;
if (a != to_load.length) {
gotoAndPlay(8);
}
}
if (_root["pic_holder"+a].getBytesLoaded<_root["pic_holder"+a].getBytesTotal) {
gotoAndPlay(9);
}
Frame11
Code:
loader.amount.text = to_load.length+"/"+to_load.length;
for (b=0; b<to_load.length; b++) {
_root["pic_holder"+b]._height = 100;
_root["pic_holder"+b]._width = 100;
}
Frame12
Code:
for (b=0; b<to_load.length; b++) {
_root["pic_holder"+b]._visible = true;
}
stop();
My SWF Works Fine With Firefox, Not With IE...
Hello all,
I have a problem with Internet Explorer (6 et 7) while everything works fine with Firefox 3 and Google Chrome.
Here is my problem :
1 – I have one SWF (a map of which can be clicked) inserted in a HTML page via the Satay method with the following code:
Code:
<!-- Swf map - Satay method -->
<div id="map">
<fieldset>
<legend>Region</legend>
<object type="application/x-shockwave-flash" data="./flash/zzzzPost.swf" width="350" height="293.8">
<param name="movie" value="./flash/zzzzPost.swf" />
<param name="wmode" value="transparent" />
</object>
</fieldset>
</div>
This insertion works fine with all the browsers: the map is displayed and the colour of the regions change when the mouse is over them.
2 – My HTML page also contains 15 checkboxes and 2 text zones that users can fill with dates.
3 – It also contains a Javascript function called valeurElements(). This function returns an array whose first indice contains the ckeckboxes that have been checked (1,7,15 for example) and the second indice contains the dates (10/30/2008,10/31/2008 for example).
I just want to specify that this function works correctly with all the browsers and return the good values when I use it with a submit button, even with IE. I am nearly sure that this function in not the problem.
4 – Finally, in the Action Script code (AS3) of my zzzzPost.swf, I read the result of the Javascript function valeurElements() so that I can affect the returned values to some variables that I place as parameters in the URL where I want to redirect users, as follows:
Code:
function sourisUp(evt:MouseEvent)
{
var valeurElements:Array;
valeurElements = ExternalInterface.call("valeurElements");
// PHP page where users will be redirected.
var adresse:URLRequest = new URLRequest("./mapage.php");
// Variables to be sent.
var variables:URLVariables = new URLVariables();
variables.type_entite = typeEntite;
variables.code_entite = codeEntite;
variables.type_evenement = valeurElements[0];
variables.date_evenement = valeurElements[1];
// Variables are sent to the URL.
adresse.data = variables;
// Datas are sent with the Post method.
adresse.method = URLRequestMethod.POST;
// URL is sent.
navigateToURL(adresse);
}
Unfortunately, if everything works fine with Firefox and Google Chrome, IE returns the following error when I click on my SWF map:
Quote:
Line : 1
Car : 7
Error : Syntax error
Code : 0
URL : http://localhost/mancom/recherche.php
I really need help to fix this problem, could you please give me a solution?
In advance, thank you very much!
Best regards,
Mafate
SWF Works Fine...HTML Does Not
I'm not sure if this should go in this section or in the General Discussions forum.
I'm attempting to write a carousel SWF that will get weather images from a XML file that is being created from a previous PHP script call. First, I know that the XML file is being created, but nothing is being passed back to the SWF. If I hardcode ECHO statements, the SWF displays the correct icons. Secondly, and most importantly, if I call the SWF file directly from the browser address line, it works fine (with the hard coded XML data). But if I embed the SWF into a HTML page...the SWF does not get the XML data and therefore does not display the icons. Why is that?
Any help would be appreciated.
TIA,
Mike
Edited: 11/18/2007 at 08:08:23 PM by kratzmike
Works Fine Firefox Not IE
i make a pop-up window. and it works fine in firefox but not in IE.
any ideas about this one. i use this code.
ActionScript Code:
_root.openWinCentre = function (url, winName, w, h, toolbar, location, directories, status, menubar, scrollbars, resizable) { getURL ("javascript:var myWin; if(!myWin || myWin.closed){myWin = window.open('" + url + "','" + winName + "','" + "width=" + w + ",height=" + h + ",toolbar=" + toolbar + ",location=" + location + ",directories=" + directories + ",status=" + status + ",menubar=" + menubar + ",scrollbars=" + scrollbars + ",resizable=" + resizable + ",top='+((screen.height/2)-(" + h/2 + "))+',left='+((screen.width/2)-(" + w/2 + "))+'" + "')}else{myWin.focus();};void(0);");} _root.openWinCentre(address, target_winName, width, height, toolbar, location, directories, status, menubar, scrollbars, resizable);*/
thanks guys.
Works Fine In Actionscript 1 But Not 2?
HI all,
ive got a pre loader that works fine when i export on actionscript 1 but not in AS2??
ive spent a week using the mx 2004 pro demo and im finding it very hard to get to grips with!!
heres all the AS for the loader
ActionScript Code:
#initclip
function LoaderClass() {
this.slideColor = new Color(this.slide);
this.bordColor = new Color(this.bord);
this.update();
}
//
LoaderClass.prototype = new MovieClip();
//
LoaderClass.prototype.update = function() {
this.slideColor.setRGB(this.scolor);
this.bordColor.setRGB(this.bcolor);
//
this.bord._width = this.SlideWidth+4;
this.slide._width = this.SlideWidth;
this.bord._height = this.SlideHeight+4;
this.slide._height = this.SlideHeight;
//
this.createTextField("mytext", 1, this.bord._x, this.bord._y, 300, 40);
delete this.mtextFormat;
this.mtextFormat = new TextFormat(this);
//
this.mTextFormat.font = this.fname;
this.mTextFormat.color = this.bcolor;
this.mTextFormat.size = this.fsize;
this.mytext.text = "";
this.mytext.setTextFormat(this.mtextFormat);
//
};
//-----------
LoaderClass.prototype.setSlideWidth = function(b) {
this.SlideWidth = b;
this.update();
};
LoaderClass.prototype.getSlideWidth = function() {
return (this.SlideWidth);
};
LoaderClass.prototype.setSlideHeight = function(h) {
this.SlideHeight = h;
this.update();
};
LoaderClass.prototype.getSlideHeight = function() {
return (this.SlideHeight);
};
LoaderClass.prototype.setTintColor = function(c) {
this.tcolor = c;
this.update();
};
LoaderClass.prototype.turnOnTint = function() {
this.applyTint = true;
this.update();
};
// Connect the class with the linkage ID for this movie clip
Object.registerClass("Loader", LoaderClass);
#endinitclip
and
ActionScript Code:
onClipEvent (load) {
_root.stop();
this.topScale = this._width;
this._xscale = 0;
ft = int(_root.getBytesTotal()/1024);
}
onClipEvent (enterFrame) {
fl = int(_root.getBytesLoaded()/1024);
this._xscale = (fl/ft)*this.topScale;
_parent.mytext.text = "LOADING "+fl+" KB OF "+ft+" KB";
_parent.mytext.setTextFormat(_parent.mtextFormat);
// _parent.llt = "LOADING "+fl+" KB OF "+ft+" KB";
if (fl == ft) {
tellTarget ("_root") {
play();
}
}
}
thanks in advance!!!
Getting Variables Works Fine But...
Hey guys I've got this code:
Code:
LoadVariablesNum ("forumstats.php", 0, "GET");
totalonline = "Online: "+this.totalonline;
threads = "Threads: "+this.threads;
posts = "Posts: "+this.posts;
It works very well, however even with the stop command, it continuously refreshes the variables, which is a drain on my bandwidth.
What can I do to get it to load ONCE ONLY? I'm using Flash MX 2004 Professional.
Cheers for any help!
LoadMovie Help Anyone? Works Fine On PC, But Not Online
Hey everyone,
Trying to use LoadMovie on a button to load a SWF (just a picture) into a MC called Preview. My code looks like this right now:
on (rollOver) {
loadMovie("files/Movie4.swf", Preview);
}
on (rollOut) {
loadMovie("files/Blank.swf", Preview);
}
on (release) {
getURL("documents/resume.pdf", "_blank");
}
This works great on my PC. Once I put in the webspace, the SWF (Movie4.swf) does not load into the MC (Preview). I can still click on the button and go to the PDF, but the loadmovie doesn't work.
Any help would be appreciated.
Mask Works Fine In Editor, Not In Swf
I have set up a mask, drawing a rectangle symbol and having it float from left to right over some text, thus relevealing it. It works great in Flash MX (editor) but when I preview it I don't see the text, or the box or anything.
Anyone have any troubleshooting tips? On OS 10.2.4, Flash MX.
Loadmovie Works Fine Until I Upload...
Hi there. I have an image gallery that loads pics from a folder called images such as below. When I try the movie locally, it works fine.
When I upload the files to my server, however, the images do not show up. I've got my targets set up the same and can't figure out what I'm doing wrong. Any thoughts?
}
if (square._alpha<10) {
loadMovie("images/image"+whichPic+".jpg", "square");
fadeOut = false;
fadeIn = true;
}
Thankyou for any help
Navigation Works Fine When Viewed On PC But Not On Mac, Why?
hi all,
when the mouse runs over a button on my navigation, the rest of the buttons are meant to fade down. it works fine when viewed on a pc, but when i uploaded my site and viewed it on a mac, the buttons don't fade. anyone have any idea why?? does flash on a mac not support some script?
[CS3][A2] Gallery Works Fine In IE, But Not In FF And Opera
hey
ok, not sure how simple this is, but ive made a gallery, loosely based on the kirupa one. basically, I have a border that resizes, then the image shows in it. This all works fine in IE, but when it is viewed in FF and Opera, the box does not resize, it goes all small. Hard to explain lol. here are some links;
the actual flash page:
http://munkydesigns.co.uk/burls/index.html
the files
http://munkydesigns.co.uk/burls/burls.zip
Here is the code in question for the resizing:
PHP Code:
function resizeMe(w, h){
mc_border._visible = true;
var speed = 3;
_root.mc_image._alpha = 0;
mc_border.onEnterFrame = function(){
this._width += (w - this._width)/speed;
this._height += (h - this._height)/speed;
if(Math.abs(this._width-w)<1){
this._width = w;
this._height = h;
_root.mc_image._x = this._x - this._width/2 + spacing/2;
_root.mc_image._y = this._y - this._height/2 + spacing/2;
_root.mc_image._alpha = 100;
delete mc_border.onEnterFrame;
}
}
}
Ive got to have this in for a deadline on Monday
If anyone can help, it'd be greatly appreciated!
My First Button Bar, Almost Works, Just Needs Some Fine Tuning
Total newb here, but I couldn't find anything through searches for this particular problem.
I can't get a couple bugs out of my navigationmenu, I want to make a drop-down menu that allows me to have the drop-down menu's drop-down over HTML, an image, or possibly another Flash object.
I want the flash menu to retract when you go from one button to another, however currently it only retracts if your mouse moves over the invisible button, but because my dropdowns are wide, sometimes the mouse will pass directly from the drop-down, to the button, and not pass over the invisible button. There must be another way to code the drop-down to retract the first menu when you mouseover the 2nd menu... Currently I sometimes have 2, or even 3 menu's open simultaneously. Here is what I am talking about:
I took a screen capture of the overlapping menu's, it is at this link. Any advice is very much appreciated.
This is a link to a screenshot
http://www.trittonusa.com/Images/buttonbarproblem.bmp"
And this is a link to my .fla file
http://www.trittonusa.com/Images/ButtonBare.fla
I also currently have the size of the drop-down menu such that when I try to insert it into an HTML file, it makes a large space below it, when I try to make it smaller, the drop-downs don't appear.
Thanks in advance for any advice you guys can provide, I really appreciate it.
LoadmovieNum Works Fine On Harddisk But Not On The Web
I'm really a flash rookie so I often have problems that may result really basics.
I've searched the forums without results. My homepage is a swf that after a short intro stops and loads "start.swf" on top (same folder), which contains all my menu items.
The same when you click on a button (part of the start.swf) you load something else on _level2 on different folders in this case (i.e. "english/main.swf" or "spanish/main.swf", ... ), and so on.
Everything works fine on my pc, but when I try on my web space the introduction starts and at the end it doesn't load "start.swf" eventhough they are on the same folder. Here is the code inserted in the last keyframe of my homepage.swf. Thank for your help.
ActionScript Code:
loadMovieNum("start.swf", 1);
stop();
_paolo
.swf Works Fine On My Machine.. But Not Once Uploaded
i'm having troubles with a jukebox script i found by eric bridges.
the .fla
my problem is that it works on my machine.. but not once i upload it to a website. http://www.akae.net/abide/music.swf
it looks like its not reading the txt file... but its all in the same directory soo i can't figure out why that would be.
if anyone could give me some advice i'd really apreciate it.
Terrible Issues With AS3. AS2 Works Fine.
Okay I've just got around to converting a game-in-progress of mine to AS3, all in classes. The code inside class Character mimics the coding inside the sonic movieclip of the AS2 version. The code is exactly the same in execution, it is simply structured slightly differently so it is more organized as a class.
The failed hittests when transferring over a block isn't even all of it. It looks choppy, and the character will begin to walk into the block when on a curver, and eventually fall through it.
This is a very big problem for me. Any help would be very, very, very much appreciated.
AS2 Version (Simply click Play, Main, then New Game)
AS3 Version
MC Won't Work In Timeline - Works Fine On It's Own
Hi Everyone,
I have a simpel 5 page website which is controlled by my main timeline. The first movieclip which is an animation works fine. The second movieclip which is an interactive scrolling gallery does not work.
(All the movie clips are controlled by the menu link buttons, which indicate which frame to play upon release).
When I test the scene on the movieclip itself, independent of the main timeline it works fine, however once I drop the instance into my main timeline it no longer works.
Can anyone help please? Any help is much appreciated.
Thank you.
|