Detect URL
I know how to get the URL (Movie.url) of the swf in question, but my question is: how to get the main URL if the swf is inside an iFrame or frame.
I know how to use javascript to get the parent window URL, but I have to do this without javascript.
Thanks.
ActionScript.org Forums > ActionScript Forums Group > ActionScript 3.0
Posted on: 07-10-2008, 01:16 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
To Detect Or Not
Here's my dilemma. I want to start a MC once another moving MC reaches a certain position. I tried detecting the _y position of the moving MC through a button action. (press button, if (_y > 20) goto) Simple right? Well, it doesn't work. Now I'm wondering if it doesn't work because the action is attached to a button. Or if I should use collision detection. Any advise from all those flash guru's out there on the best way to do this.
I'm willing to send out the fla if necessary.
-Casper
How To Detect The
Speed = ( _level0.getBytesLoaded()/ 1024 ) / (getTimer() / 1000)
isn't working or not showing the correct speed
How To Detect
HI everyone,
I have made a form and wann to check valid data i.e if alpanumeric value is req. user cannot enter numeric value and vice versa. I found no inbuilt fn. in flash which could detect whther the entered value is string or numeric.Now how should i check this ..pls. help
MX Detect
How are you detecting MX player. Is their a componet that I just didn't see at MM site.
Detect Key
Hello,
i have a menu with 3 options: "1", "2", "3".
i want to detect when key 1, 2 or 3 is pressed. When it's pressed i want variable Answer to be equal to the pressed key. If another key is pressed so it will keep waiting for a valid answer.
Thanks,
Miguel
Key Detect
Hello,
i have this code to check if the Key 1 is Pressed:
Key.addListener(Key);
Key.onKeyDown = function(){
var dwn = String.fromCharCode(this.getAscii());
if (dwn.length) this.broadcastMessage("onKey"+dwn+"Down");
}
Key.onKeyUp = function(){
var up = String.fromCharCode(this.getAscii());
if (up.length) this.broadcastMessage("onKey"+up+"Up");
}
Key.addListener(this);
this.onKey1Down = function(){
trace("1");
}
However i also wanted to make it work with keys such as Enter, Esc and Space. Can somebody tell me how can i that using this code?
Thanks,
Miguel
Key Detect
Hello,
i have the following code to detect if the keys 1, 2, 3, Enter, Space and Escape are pressed:
keyListener = new Object();
keyListener.onKeyDown = function() {
if (Key.getCode() == Key.SPACE) {
trace("SPACE");
} else if (Key.getCode() == Key.ENTER) {
trace("ENTER");
} else if (Key.getCode() == Key.ESCAPE) {
trace("ESCAPE");
} else if (Key.getCode() == 49) {
trace("1");
} else if (Key.getCode() == 50) {
trace("2");
} else if (Key.getCode() == 51) {
trace("3");
}
};
Key.addListener(KeyListener);
Everything works fine, except the ENTER and ESCAPE key.
Could u help me? Why the code doesn't work with these 2 keys?
Thanks,
Miguel
Detect Help Please...
I saved this-
Quote:
<j,hvj,vSCRIPT LANGUAGE=JavaScript1.1>
<!--
var MM_contentVersion = 6;
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if ( plugin ) {
var words = navigator.plugins["Shockwave Flash"].description.split(" ");
for (var i = 0; i < words.length; ++i)
{
if (isNaN(parseInt(words[i])))
continue;
var MM_PluginVersion = words[i];
}
var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
}
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0
&& (navigator.appVersion.indexOf("Win") != -1)) {
document.write('<SCR' + 'IPT LANGUAGE=VBScript>
'); //FS hide this from IE4.5 Mac by splitting the tag
document.write('on error resume next
');
document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFla sh." & MM_contentVersion)))
');
document.write('</SCR' + 'IPT>
');
}
if ( MM_FlashCanPlay ) {
window.location.replace("http://www.MYFLASHURL.htm");
} else{
window.location.replace("http://www.MYNONFLASHURL.htm");
}
//-->
</SCRIPT khglgh>
...ok I copied and pasted that in word processor and put my URLS in, then saved it as an HTML file and opened it in my windows explorer, and all it showed was the writing that is the whole file HELP
First Run Detect
I have a program that is a presentation with two parts an intro and the content. The client wants to be able not to show a skip intro button until the user has sat thru it once. Is this possible? Can someone send me some code samples? I am a dabbler not an expert and have a very basic knowledge of actionscript.
Thanks
P
Detect Swf Name
Is there a way for a swf file to detect its name?
I'm building an XML loading Flash program. I want to instruct the users to name their XML file the same thing they name the SWF files.
When the SWF file loads the XML it should look to see what its name is then load an XML file with the same name.xml
Make sense? Can it be done?
Thanks.
_t
Detect URL
What I'm trying to do is detect the url I am currently at and load an external image depending on that.
This is how I'm loading the image:
container.loadMovie("images/1.jpg");
And what I want I'm trying to figure out is:
if url == XX.pp
- container.loadMovie("images/1.jpg");
elseif
container.loadMovie("images/2.jpg");
any idea?
Detect FLV End?
I have an FLV playback component, how can I detect in AS3 when the video is finished playing?
PDF Detect
Hi,
I want to link a button for a PDF document, in a CD project.
1. Should I use 'getURL' ?? or anyother different command. The 'getURL' doesn't work
2. What is the code for detecting, if PDF is present in the users computer, else it should install from the CD (assuming, I give the Acrobat Reader in the CD)
Thanks
Nice Day!!
Detect Url
is that any way to detect a url for a flash swf start in a diferent frame....
i mean i´ve got a flash inside a html, if the url is http://www.something.com/index.htm to start in frame called home. (just with actionscript)
thank´s very much
Alex
Detect When Not On Swf
I need some information here please.
I have created a slider bar to select a scene to play. The scene selection works fine, however I noticed the following scenario. If the user clicks and drags the selector and drags the mouse off of the swf area (does not matter if they release the button or not) )and then moves back into the swf area the slider will continue to follow the mouse and the user must click to reactivate the settings. So the question is how exactly do I detect when either A. the user leaves the swf area or B. Enters into the swf area (but not have this continuously firing off)?
Detect Help Please...
I pasted
Quote:
<SCRIPT LANGUAGE=JavaScript1.1>
<!--
var MM_contentVersion = 6;
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if ( plugin ) {
var words = navigator.plugins["Shockwave Flash"].description.split(" ");
for (var i = 0; i < words.length; ++i)
{
if (isNaN(parseInt(words[i])))
continue;
var MM_PluginVersion = words[i];
}
var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
}
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0
&& (navigator.appVersion.indexOf("Win") != -1)) {
document.write('<SCR' + 'IPT LANGUAGE=VBScript>
'); //FS hide this from IE4.5 Mac by splitting the tag
document.write('on error resume next
');
document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFla sh." & MM_contentVersion)))
');
document.write('</SCR' + 'IPT>
');
}
if ( MM_FlashCanPlay ) {
window.location.replace("http://www.MYFLASHURL.htm");
} else{
window.location.replace("http://www.MYNONFLASHURL.htm");
}
//-->
</SCRIPT>
in my word processor and put my URLS in, then saved it as an HTML file, then tried to open it in my windows explorer, and it jus showed the writing, like the whole script writing, why didnt it work???
Hit Detect
I am making a 1st person shooter airsoft game ( like paintball but with bbs). How do I make it so when you shoot someone a red dot ( blood ) appears where you hit them? (you will hit the same person like 20 times so you would get 20 diff dots.)
Thanks
Detect Help Please...
I pasted
Quote:
<SCRIPT LANGUAGE=JavaScript1.1>
<!--
var MM_contentVersion = 6;
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if ( plugin ) {
var words = navigator.plugins["Shockwave Flash"].description.split(" ");
for (var i = 0; i < words.length; ++i)
{
if (isNaN(parseInt(words[i])))
continue;
var MM_PluginVersion = words[i];
}
var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
}
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0
&& (navigator.appVersion.indexOf("Win") != -1)) {
document.write('<SCR' + 'IPT LANGUAGE=VBScript>
'); //FS hide this from IE4.5 Mac by splitting the tag
document.write('on error resume next
');
document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFla sh." & MM_contentVersion)))
');
document.write('</SCR' + 'IPT>
');
}
if ( MM_FlashCanPlay ) {
window.location.replace("http://www.MYFLASHURL.htm");
} else{
window.location.replace("http://www.MYNONFLASHURL.htm");
}
//-->
</SCRIPT>
in my word processor and put my URLS in, then saved it as an HTML file, then tried to open it in my windows explorer, and it jus showed the writing, like the whole script writing, why didnt it work???
Hit Detect
I am making a 1st person shooter airsoft game ( like paintball but with bbs). How do I make it so when you shoot someone a red dot ( blood ) appears where you hit them? (you will hit the same person like 20 times so you would get 20 diff dots.)
Thanks
Detect OS
Hello
I was wondering if there was ANY way to detect OS...
Because with Vista, I found that my site looks horrible (FF & IE) just because of coloring of the Browsers..
So if I detect the OS, at least I can make it good for Vista
Keehun
Help Me With Collision Detect Please
Hello.
I want to be able to roughly duplicate this:
http://www.zanpo.com/index2.html
Like an old adventures of lolo type game.
I can make the dude move and keep him from going off the screen (pretty well - help here too if you want). I can't seem to figure out how to keep him from running into walls I make. How should I make the walls. Does everything have to be in a grid? Please help!
Is This The Best Way To Detect If Mouse Is In MC?
I want a movie clip to have the "Mouseover" effect of a button. (refer to previous post for explanation http://board.flashkit.com/board/show...readid=210471)
Is this the best way? It seems extremely convoluted.
The code is below, but in a nutshell:
Decide if the _xmouse position (relative to MC) made positive is less than half the width of the movie &&
if the _ymouse position (relative to MC) made positive is less than half the height of the movie.
onClipEvent(mouseMove){
this.X = this._xmouse;
this.Y = this._ymouse;
if (this._xmouse >= 0){
MyX = this._xmouse;
} else {
MyX = this._xmouse - (this._xmouse * 2);
}
if (this._ymouse >= 0){
MyY = this._ymouse;
} else {
MyY = this._ymouse - (this._ymouse * 2);
}
if ((MyX < this._width/2) && (MyY < this._height/2)){
this._alpha = 60;
// I used _alpha for testing purposes, anything can go here
}else{
this._alpha = 100;
// I used _alpha for testing purposes, anything can go here
}
}
Detect Resolution And Then..
This may have been answered a few times, but I couldn't find an answer searching the forums..
I need to be able to check the resolution of the user, and based on that either launch the flash intro full screen or into a popup window ie. if the user's resolution is 800x600 go FS, else window.open ect ect.
Any ideas? Do I do it in the flash itself, or the index.html with javascript, or more likely, both ?
Thanks in advance!
Stefano
Resolution Detect?
hey! anyone know if its possible to dectect a users monitor resoultion and play the right movie for them using flash? I think it could be done using javascript but I would have a clue. Any help would be great. cheers
Detect Frame
How can i detect from a flash movie which is the current URL in the mainFrame?
Insert Key - Can I Detect If This Is On Or Off?
Can I detect to see if the Insert Key is on or off when I load an swf? I know I can check to see if it is pressed while the swf is playing, but I need to know if it's on or off to start with.
Cheers for any response or help
charlie
Flash Detect
HI!
I have a flash animation running in the top section of my homepage. If the user doesn't have the flash 5 player installed, i would like him to see a gif image instead of the flash animation.
1- what is the script that needs to be put for both IE and NS , in order for him to see the gif image instead
2- how do i test the script to see if it is well functionning when I have on my PC the flash player plugin !?! (this is a funny situation, but i should be able to test it, right?!)
The question goes mainly for NS 6
Thanks for ur reply
Rania
Detect Sound
I am using a simple Actionscript to load and play a sound file:
_root.sound1.s1.setVolume(30);
_root.sound2.s1.start();
I would like to have a movie clip play when the sound clip ends. Any suggestions?
Detect Browser
is there any way to detect the user's default browser?
I'm making two type of php file to serve IE and Netscape separately. So I need to know the browser
Detect Plug In
I'm looking for a FLASH 4 tuitorial on how to detect whether the viewer has the plug in
Thanks to anyone who responds
michael
Detect Array?
Pardon my idiocy, but there aren't many code examples dealing with detecting arrays in actionscript. Is this proper syntax for detecting whether a variable doesn't exist and that it's not an array?
if ((!attributes) || (attributes.length != "")) {
code
}
MAC To MAC/PC = DETECT/INSTALL
I am new and I am using Flash 5.
Can you tell me how a mac could autodetect if a mac has flash and begin to install it, from an included copy, if it doesnt?!
As I can burn a hybrid cd, can I also have it autodetect for flash on a pc?! how?!
If one or neither, what would be the easiest way of giving the user a copy of flash 5, short of including a pc and mac copy on the cd and asking them, in a readme, to just install it themselves?!
How To Detect OnMouseOutOfMovie?
It's simple as that:
OK, while in the SWF movie (stage), I have an element that follows the mouse position.
However, my question involves mouse movement when embedded within the HTML page.
How do I recognize thie "onMouseOutOfMovie", is there such a method? a good way to force it to work even if the mouse moves fast out of the movie zone?
Thanx,
Tal.
Auto Detect
Is there anyway (YET) to detect FLASH PLAYER 6 ?
I can't believe that Macromedia has released MX with
this problem being such a huge issue. WTF.
I have a fair amount of video in one project, which obviously requires FP6 to view. But ASKING the viewer to
download FP6 really SUX.
So if anyone has any info on the subject PLEEZ HELP ME!!!!
Flash Detect
i want to use the $Vertion metod to detect the flash 6 player. Any ideas on how i should script it.
--i was thinking something like this---
if($Vertion==6){
play
}else{
stop
}
}
How To Detect Collision?
I want to make a simple game. Ive made an MC of a guy running. when i click somethin the guy jumps. and there are objects coming his way.. like a box at the level of his feet. What i need is a code, that when the MC of the runner colides with the MC of the box, i can make it got to frame 2.
Please help! I appreciate it
Tigran
Detect If A Layer Is Used?
how do i detect if a particular layer is currently occupied by a swf?
Furthermore, can this detection of whether a layer is occupied include an if / then statment to take different actions depending on whether or not a layer is occupied.
thanks,
b
How To Detect Swf Movie With Php
Hi,
I have a swf movie contacting a PHP script with loadvariables(), the variables are being sent with "POST".
I would like to detect within the PHP script if the script was called by the swf and whithin my domain. Anyone knows how can I do it? Passing a variable inside the swf would be the easier way, but it would be a security breach because with the proper software anyone can open the swf and read the variables I'm sending. So I'm looking for some kind of internal variables being sent by the SWF.
Any help would be appreciated,
Kind Regards
Helio
Detect Player
I've been to some sites that detect if you have Flash 6 player or not. Where can I find out how to do this or get the script from? Some even tell me what browser I'm using, screen res and if my processer is speed is fast enough.
Thanks for any info,
later.
Flash Detect
hi can anyone tell me where to start with a flash detect ?
Ive just created a site in flash mx and i want it to check for flash 6 player ect ect
Please help
Can Flash Detect A URL?
Hello.
I have a navigation made in Flash used on a PHP page. I need Flash to detect what page it is on and go to a certain frame in the navigation. How do you do this?
I only want to use the one navigation so it doesn't have to completely load on every page.
Thanks for any relplies
Way To Detect And Use Cpu Speed?
Is there a way to detect and evaluate an if statement based on a users cpu speed? I have a project with some large pictures set to fade in and out. The program runs fine on a 600 mhz machine but when I tested it on a 233 it runs very slow and very choppy. I was wondering if there was a way I could check the users cpu speed and based on that play a different movie without the alpha fade tweens on the pictures for slower users. This movie will run as a projector file.
Detect Flash 6
Hello can anyone help me to detect that the user has flash pluggin
Detect Movieclip
Can someone tell me how i can get FMX to detect what's the movie clip name that is loaded on to a another movieclip on a time line is and store that data?
Also is there a way for flash to store the frame name or number and the scene the playhead is on? tnks
Flash Detect For MX?
I just downloaded this Flash Detect Kit off of the Macromedia site.
It's about 20 files and pages of instruction.
I'm sifting through it and had the thought that perhaps some of my brilliant flashkit associates might know of other tutorials or source files on the subject.
Here's what I'm using:
http://www.macromedia.com/support/fl...oyment_readme/
Best Regards,
KQ**************
********
How To Detect Flash 6?
I'm using the deployment kit to detect flash 6, but its option only allow flash 3 to 5.
Can anyone tell me how to detect 6???
Cheers
ss
How To Detect If .swf Exsits
I'm using a loop to load a list of child clips...the list of clips to load is produced by my db. If the clips exist, everything works fine. Obviously, if the loop calls for a file that doesn't exsit i have problems.
So how do I error trap non-existant clips?
Here's the relavent code:
Code:
// duplicate the container MC
_root.container.duplicateMovieClip(newName, count);
//what can i put here to keep the next statement from firing if
// the var 'listofswf' holds a name to a clips that doesn't exist?
// load the next movie in the sequence into the new container
loadMovie (listofswf, newName);
|