Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




[FCS3]How To Call External SWF's



I am creating an eLearning class using Flash CS3.

I would like to use basic controls to control the class (i.e. play, next, back). What I am trying to figure out is how to each new slide.

Example: At the main menu screen users have three different chapters they can go to, each chapter is a seperate .SWF file. How do I call this SWF so that it loads and plays, without it being in a seperate FLV playback window?

Anybody have any ideas on how to do this? I am sure it is possible, but I am new and ignorant.

I do not want to use the slide show application becaquse it only supports AS 2.



FlashKit > Flash Help > Flash Newbies
Posted on: 06-15-2007, 08:11 AM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

[FCS3]Checking External SWF In Levels
Hello all.
I'm new to working with levels, and I'm trying to test which .swf is currently loaded into a certain level. Is there a way to do this?

What I'm attempting is to load content for a portfolio into the main swf. However, if the "home" content is already loaded and the "home" button is clicked, I don't want it to reload.

By the way, I'm using AS 2.0

Also, is there an easy way to split the scenes in a .fla into separate .fla's?

Thank you for any advice you can give me!

[fcs3] External Mp3s, Multiple Play Buttons,1 Stop Button With Fade Out - Please Help
Hey Guys,

I've been trying to set up an Soundboard as a personal project where I have about 30-40 buttons, which each are linked to an external mp3.

Currently I have it set up as 40 Separate Play and Stop Buttons using the code below. Now I'm not sure how to do this next part, but how can I modify this code, to have only 1 Stop Button for 40 Separate External Mp3 Files. (Please Don't Suggest stopAllsounds(); like someone did on another forum, that's not want I wanted)

I First Posted this on here on August 9th, and had no help, and I'm hoping that this time I can get some help for this.

On the Frame/Button:


Code:
Sound = new Sound(this);
theme.loadSound("song1.mp3");

on(release){
theme.stop();
theme.start(0,1);
}



On The Stop Button:

Code:
on(release){
this.onEnterFrame = function(){
so = _root.theme;
rate = 5;

newVolume = so.getVolume() - rate;
if(newVolume > 0) {
so.setVolume(newVolume);
} else {
so.setVolume(0)
so.stop();
so.setVolume(100);
this.onEnterFrame = null;
}
}
}

on(keyPress "<Space>"){
this.onEnterFrame = function(){

so = _root.theme;
rate = 5;

newVolume = so.getVolume() - rate;
if(newVolume > 0) {
so.setVolume(newVolume);
} else {
so.setVolume(0)
so.stop();
so.setVolume(100);
this.onEnterFrame = null;
}
}
}

External Swf Call
Hi guys, Can anyone help with this issue....?

I have a simple Dreamweaver page holding a single Flash file. In the file is a single button that when pressed uses a call to pull in an external flash file. When I test this call in Flash it works perfect. When I test it in Dreamweaver on my PC it works perfect. However when I upload the files to a web server the Dreamwever page displays the flash file perfect but the call does not work when I click the button.

Is there a specific type of Dreamwever page that is required to allow dynamic flash sites or this type of Call. The fact that it works fine on my pc when i test it, should indicate that everything is correct?

Frustrated Newbie

To Call Swf External, Xml Does Not Appear
I am with a problem, I have my main file that has the normal menu that he would be principal.swf, I is using this to call the other .swf that he would be noticias.swf, that would have a project of the news in xml.

Code:
// AS do button menu 2 chamar noticias.swf.
menu2_mc.onPress = function ()
{
loadMovie("noticias.swf", 1);
};
what I am using in xml is this

Code:
// noticias xml
stop ();
//
System.useCodepage=true
//call xml e css
var estilo = new TextField.StyleSheet ();
var arquivo_css = "xml/jr.css";
estilo.load (arquivo_css);
estilo.onLoad = function (correto)
{
if (correto)
{
var meuXML:XML = new XML ();
meuXML.ignoreWhite=true
meuXML.load ("xml/jr.xml");
meuXML.onLoad = function ()
{
_root.tela_mc.plana_mc.jr_txt.text = meuXML;
};
}
jr_txt.styleSheet = estilo;
};
my problem is following, when I compels my file noticias.swf it appears normal with the news, but when I am in the file principal.swf and click in button 2 menu it brings me the file noticias.swf but without xml, xml does not appear no way, somebody knows as I can fixed this?

To Call Swf External, Xml Does Not Appear
I am with a problem, I have my main file that has the normal menu that he would be principal.swf, I is using this to call the other .swf that he would be noticias.swf, that would have a project of the news in xml.


Code:
// AS do button menu 2 chamar noticias.swf.
menu2_mc.onPress = function ()
{
loadMovie("noticias.swf", 1);
};
what I am using in xml is this


Code:
// noticias xml
stop ();
//
System.useCodepage=true
//call xml e css
var estilo = new TextField.StyleSheet ();
var arquivo_css = "xml/jr.css";
estilo.load (arquivo_css);
estilo.onLoad = function (correto)
{
if (correto)
{
var meuXML:XML = new XML ();
meuXML.ignoreWhite=true
meuXML.load ("xml/jr.xml");
meuXML.onLoad = function ()
{
_root.tela_mc.plana_mc.jr_txt.text = meuXML;
};
}
jr_txt.styleSheet = estilo;
};
my problem is following, when I compels my file noticias.swf it appears normal with the news, but when I am in the file principal.swf and click in button 2 menu it brings me the file noticias.swf but without xml, xml does not appear no way, somebody knows as I can fixed this?

How To Call A MC From A External SWF?
Does anyone know how I can call up a movie clip in a swf from another external swf?

To Call Swf External, Xml Does Not Appear
I am with a problem, I have my main file that has the normal menu that he would be principal.swf, I is using this to call the other .swf that he would be noticias.swf, that would have a project of the news in xml.


Code:
// AS do button menu 2 chamar noticias.swf.
menu2_mc.onPress = function ()
{
loadMovie("noticias.swf", 1);
};
what I am using in xml is this


Code:
// noticias xml
stop ();
//
System.useCodepage=true
//call xml e css
var estilo = new TextField.StyleSheet ();
var arquivo_css = "xml/jr.css";
estilo.load (arquivo_css);
estilo.onLoad = function (correto)
{
if (correto)
{
var meuXML:XML = new XML ();
meuXML.ignoreWhite=true
meuXML.load ("xml/jr.xml");
meuXML.onLoad = function ()
{
_root.tela_mc.plana_mc.jr_txt.text = meuXML;
};
}
jr_txt.styleSheet = estilo;
};
my problem is following, when I compels my file noticias.swf it appears normal with the news, but when I am in the file principal.swf and click in button 2 menu it brings me the file noticias.swf but without xml, xml does not appear no way, somebody knows as I can fixed this?

To Call Swf External, Xml Does Not Appear
I am with a problem, I have my main file that has the normal menu that he would be principal.swf, I is using this to call the other .swf that he would be noticias.swf, that would have a project of the news in xml.


Code:
// AS do button menu 2 chamar noticias.swf.
menu2_mc.onPress = function ()
{
loadMovie("noticias.swf", 1);
};
what I am using in xml is this


Code:
// noticias xml
stop ();
//
System.useCodepage=true
//call xml e css
var estilo = new TextField.StyleSheet ();
var arquivo_css = "xml/jr.css";
estilo.load (arquivo_css);
estilo.onLoad = function (correto)
{
if (correto)
{
var meuXML:XML = new XML ();
meuXML.ignoreWhite=true
meuXML.load ("xml/jr.xml");
meuXML.onLoad = function ()
{
_root.tela_mc.plana_mc.jr_txt.text = meuXML;
};
}
jr_txt.styleSheet = estilo;
};
my problem is following, when I compels my file noticias.swf it appears normal with the news, but when I am in the file principal.swf and click in button 2 menu it brings me the file noticias.swf but without xml, xml does not appear no way, somebody knows as I can fixed this?

To Call External Movie
I need help on actionscript in flash.

I got 2 swf files which is A and B. Let say I got a button to click in the Movie B to call Movie A at the certain timeline/frame, how can I do it.

Thank you.

Call An External SWF Movie
I am needing to call a .swf movie embedded in a page and tell it to play when another movie on the same page finishes.

Is there a way to call an external movie from within another movie?

Thanks

How Do I Call From An External Movie To Another.
Hi,

How do I do this? Here's an illustration...

I need to go to play a frame in main.swf from subnav.swf.
How do I call the frame in main.swf?



thanks,
Archie

External Application Call
I tried to make button with action fscommand and exec following flash help instructions, but when i made folders and copied my application into this folder nothing happends when i push my button.

Call An External Txt File
ok using the scroll bar, i want to call a txt file to show up in the scroll box. Do i call txt or html? what tags can i use and not use in the file that will be in the text box? Ive looked around and have had no luck..

-thanks

Preload External Swf Or Mp3 Before You Call It?
Hi,

Is there a way that you can preload an external swf and/or external mp3 before you load it into your movie? For example, if I want to preload all my mp3s right when they go to the site rather than when I call on that mp3.

Thanks,

Heather

Preload External Swf Or Mp3 Before You Call It?
Hi,

Is there a way that you can preload an external swf and/or external mp3 before you load it into your movie? For example, if I want to preload all my mp3s right when they go to the site rather than when I call on that mp3.

Thanks,

Heather

How Can I Call External IMAGE In To My Swf ?
Hello Guys

I need some help !! How can i call a external JPG file into my SWF?

I want something like the following :

www.mydomain.com:
--> images (folder: which has all my images)
--> index.swf
--> index.html

What i need is, when i run the swf file it has to show a IMAGE from the "images" folder.

I badly need it.... can anyone help me out??
thanks

External Script Call
Here is the problem.
For example
my flash is on www.whatever.com, after a while it needs to call one script from another web page, this one for example http://aaaaaaaaaaaa.com/xxx.php?a=15&s=77

Is it possible, and how?
Thanks!

Help- How To Call An External File?
Hi, anyone know what code which I can use to activiate an external file in flash like .xml, .exe, etc? I tried getURL, but think it wont open the file.

Cna someone help me?
Thanks.

Call Script From External Swf
hello,

I got an external swf and the main swf.
The external swf contain some actionscript on frame 1 (externalFrame1Label)
On frame 1 (Frame1Label) of the main swf I load the external swf, target on an empty mc "mtyMC"
On frame 2 of the main swf, i got a button and a textbox

I use the call function to call the actionscript in external swf which i loaded into the main swf on frame 1.

can someone help me get the correct path to the external swf? i try:
_root.Frame1Label.mtyMC.call("externalFrame1Label" );

but i can't see to make it to work.

any help would be appreciate.

How Do I Call From External Source?
Im making a flash document and burning it on CD, when it plays I want to be able to click on a button to download images from the CD in a folder onto the desktop.

how do I make this happen anyone have any script?

Call External Function
Good Mornin',
I've a lil' problem with external files, I created one of them calling it AttachMovie.as and I put it into a folder called myClass; Inside this "as" file I delcared a function ( photoGallery(s); )to create dynamic photogalleries;

On my flash file I did write:


Code:
import myClass.Attachmovie;

var photogallery:MovieClip = new MovieClip();
photoGallery(photogallery);
But in this way it seems to gets problems to read the photoGalley function... which is the problem??

How Can I Call External Swf's Function?
www.a.com/A.swf loads www.b.com/B.swf

B.swf has "sayHi()" private methods and it's exposed though ExternalInterface.addCallback.

As you know, i can't call that methods directly like below.


ActionScript Code:
var loader:Loader;
var req:URLRequest;
var loadedSWF:Object;

loader = new Loader();
addChild(loader);
           
req = new URLRequest("http://www.b.com/b.swf");
loader.load(req);

loader.contentLoaderInfo.addEventListener(Event.COMPLETE, initHandler);

function initHandler(e:Event):void {
    loadedSWF= loader.content;
    loadedSWF.sayHi(); // it will makes an error.
}

How can i call B.swf's method exposed though ExternalInterface.addCallback in A.swf's code?

Preloading External Swf's To Call On Later
I am trying to Preload my external swf's so that when i call them later they will be preloaded and i can go to a specific frame. I have tried that and all it does is go to the first frame of the movie. Not the Specific frame. What might i be doing wrong?

External Call From Another Thread
Hi all,

Flash player 9 (9.0.28.0) crashes every time when I try to call Action Script function from my container from worker thread.

Idea is to make ExternalInterface.call() from Action Script that will start new thread in container and return control to flash. When this new thread finishes it calls Action Script method. If I do the same from main thread everything is ok but in this case I have blocking call and UI is locked until my operation finishes. But when second thread finishes and I call Flash's CallFunction() with properly formated string, it throws "Access violation" and crashes before it comes in Action Script method.


Am I doing something wrong or there is a bug in player?

Is There A Way To Call A Function In A External Swf?
I have two swf's... one that loads another... just like the following code.
Is there a way to call the function "test()" in the "2.swf"?







Attach Code

1.swf:
var mcLoader:MovieClipLoader = new MovieClipLoader();
var mc:MovieClip = this.createEmptyMovieClip("mc", this.getNextHighestDepth());
mcLoader.loadClip("2.swf", mc);
// how to call test() in 2.swf?
-------------------------------------------------------------------
2.swf:
function test() {
return "test result";
}

























Edited: 04/02/2008 at 08:03:16 AM by renatohonjo

How To Call From An External SWF The Main SWF
Please I need help.,

I load an external SWF movie in my main SWF ( I use tell a target with an empty movieclick) I need that when this external SWF ends go to a XXXXXX Frame but in the main SWF no in the same external SWF.


Thanks

Pablo Gill

Preloading External Swf's To Call On Later
I am trying to Preload my external swf's so that when i call them later they will be preloaded and i can go to a specific frame. I have tried that and all it does is go to the first frame of the movie. Not the Specific frame. What might i be doing wrong?

Where To Call External .as Files
Im using external .as files to hold some of my functions, however if i include a function inside a movieclip, that its held in an external .as file, it needs
Code:
#include "someActionscript.as"
before it to work, surely this cant be the way to call your .as? As this means everytime I change the verison numbers on the .as file, I have to update every part of the fla which calls it...

dai2

Help To Call External Javascript In A Pdf Doc
Can someone help me with the following?
My problem:
I have a button that has to open a pdf doc. (in acrobat and not in a explorer window).
I know that in Acrobat I can have a document level javascript..
but how do I call this javascript from flash?

Preloading External Swf's To Call On Later
I am trying to Preload my external swf's so that when i call them later they will be preloaded and i can go to a specific frame. I have tried that and all it does is go to the first frame of the movie. Not the Specific frame. What might i be doing wrong?

Preloading External Swf's To Call On Later
I am trying to Preload my external swf's so that when i call them later they will be preloaded and i can go to a specific frame. I have tried that and all it does is go to the first frame of the movie. Not the Specific frame. What might i be doing wrong?

[fcs3]
Hello, novice here

Right the basic problem is this:

I have one Main.swf file and I’m importing symbols from a seperate.swf using the import for runtime sharing options. What I have in the Main.swf is a container symbol and in the separate.swf file I have a symbol containing a bmp that needs to scale up at runtime when it is imported by the Main.swf to fit the size of the container symbol. Do you know if this is this possible?

I have the importing/exporting part working fine, it is just the scaling that I can’t get to work. Any ideas

[Fcs3]
hi, ive been trying to make myself a portfolio using flash cs3, and so far everythings been running pretty smoothly, ive been following a tutorials by cartoonsmart.com, but ive started running into some trouble now, i created a function that tweens out a section off to the side when i click on a new section, but for some reason the tween refuses to work with certain sections...even tho the code for each section is identical...

heres the code:

frame one(the function)

Code:
function swapSections(){

if (sectionVar == "home"){
new mx.transitions.Tween(home_section, "_x", mx.transitions.easing.Regular.easeOut , 95.0, 800, 30, false);
}
if (sectionVar == "about"){
new mx.transitions.Tween(about_section, "_x", mx.transitions.easing.Regular.easeOut , 75, 800, 30, false);
}
if (sectionVar == "contact"){
new mx.transitions.Tween(contact_section, "_x", mx.transitions.easing.Regular.easeOut , 95, 800, 30, false);
}
if (sectionVar == "sigs"){
new mx.transitions.Tween(sigs_ection, "_x", mx.transitions.easing.Regular.easeOut , 75, 800, 30, false);
}
if (sectionVar == "sites"){
new mx.transitions.Tween(sites_section, "_x", mx.transitions.easing.Regular.easeOut , 95, 800, 30, false);
}

}
frame 50(home)

Code:
new mx.transitions.Tween(home_section, "_x", mx.transitions.easing.Regular.easeOut , -700, 95, 30, false);

// function called to move out the old section (this function is on frame 1)
swapSections();

//variable used in the function above to determine the current section
sectionVar = "home";

stop();
frame 60 (about me)

Code:
new mx.transitions.Tween(about_section, "_x", mx.transitions.easing.Regular.easeOut , -700, 75, 30, false);

// function called to move out the old section (this function is on frame 1)
swapSections();

//variable used in the function above to determine the current section
sectionVar = "about";
frame 70 (contact me)

Code:
new mx.transitions.Tween(contact_section, "_x", mx.transitions.easing.Regular.easeOut , -700, 95, 30, false);

// function called to move out the old section (this function is on frame 1)
swapSections();

//variable used in the function above to determine the current section
sectionVar = "contact";
frame 80 (sigs)

Code:
new mx.transitions.Tween(sigs_section, "_x", mx.transitions.easing.Regular.easeOut , -700, 95, 30, false);

// function called to move out the old section (this function is on frame 1)
swapSections();

//variable used in the function above to determine the current section
sectionVar = "sigs";

[fCS3] Why? Just Why?
Sorry about the unclearness of the title but that's the question i have been asking myself all day!

I am making a part in my flash game where you can select the level. I have made an input text box and set the var name to levelinput. Then i made a button and gave it this code:


Code:
on(release, keyPress"<Enter>"){
if(levelinput.toLowerCase eq "tutorial"){
gotoAndStop("Scene 2", "tutorialstart");
}else if(levelinput.toLowerCase eq "level1"){
gotoAndStop("Scene 3", "hsstart");
}else{
gotoAndStop("Scene 1", "invalidlvl");
}
}


for some reason i always get the invalidlvl frame. I would really appreciate some help guys, cos i haven't even done the main part of the game yet, and i don't like moving on while things don't work.


oh, btw, i made sure the frame labels are correct and used the script assist to confirm it. nothing wrong with the code... I followed a tut on this kind of thing and that didn't work either....

Makinga Call To An EXTERNAL File From Within A SWF
Hi

I tried this back in the days of Flash 5, and i couldn't get it to work, but i thought maybe with MX out and all, maybe there's a way

I have a SWF file, and i've got buttons on it, that i'd like to open files on my hard drive. for instance, one button i'd like to set to: C:program filesgameswarcraft3.exe for example. how would i set that up?! I tried everything on Flash 5, and then in the end just gave up, assuming Macromedia didn't want (for security reasons obviously) any SWF to be able to execute a file on the hard drive, but with MX is there a way?

Is there a way using ANYTHING?

Please help, thanks
~Lorenzo

Call External PHP File With JavaScript
Im using a web analiser (http://www.web-script.com/analiser/) with works perfect by itself.

I placed some JavaScript Code on my index.php, witch includes my swf file. (http://www.streetedge.nl/index.php)

When a button is clicked, i want flash to open another php file (http://www.streetedge.nl/Hits/home.php) This file also includes the Javascript code, witch tells web analiser that someone visited Hits/home.php (or exually clicked the button home!). Al of this has to be done hidden, so the user wont see the home.php script is opend.

I tried it with loadvars, and with load movie. Both won't work...

How Call An External Mp3 Out Of The Root Foldre
I call the mp3 in the root folder , using the media components

player.setMedia("m0s1p3.mp3", "MP3");
player.play();

the root folder is a module multimedia m0s1 and need, call sounds in the folder glosary in the same level that m0s1.

tks 4 ur help

How To Call External SWF's That Have Been Loaded Into Levels?
Hi all,

Well ive read through a lot of threads of loading external SWF's and i am still in search of what i am looking for.

I have a real simple movie.swf (Flash 8)that loads external.swf's when called so by buttons with the loadMovie("exernal.swf") function, into an empty movieclip("Container") on the main timline. I understand that the container mc will replace the external.swf's as new ones are loaded into it, leaving the previous external.swf to load again when called upon.

I guess my question or concern is that when an external.swf is loaded, their is too much of a delay. I would like to load all the swfs as the user is looking at the main page, "behind the scenes."I think i have a grasp on levels and loading the swfs into levels,(loadMovie("external.swf",1) but once they are loaded into levels, how are they then called from the button to play? And are these levels within my container MC?

I am searching for some/any suggestions about the method i should take here to load these swfs.

Thanks everyone for reading this and helping out

Matt

External Interface Call Not Working?
Howdy.


I have my Flash document on a JSP page on a sever I am viewing in Tomcat. I have an ExternalInterface.Call(javascriptfunctiongoeshere) ; on a couple of the buttons I have.

When viewing on my own computer on a simple HMTL page, the thing works fine, but when I try it on my JSP Page, it doesn't work at all... does anyone have any idea what could cause this?

Thanks.

External Txt Call - Limit Bandwidth
Hello.. I am currently trying to figure out a way to limit the bandwidth from an actionscript that calls an external text file... I have a scrolling news ticker type movie that calls a small txt file remotely. it then scrolls it across the ticker area but without some form of delay it continuously calls the file every 10 seconds.
Is there a way to have the variable load into the movie for a period of a minute before calling back to the text file to see if the content changed and then load that content and keep that variable info? It is probably something simple... But anyway here is the code I am using to create and call the text...

/-------------------------------------------------------/
this.createTextField("flash_txt", 0, 0, 0, 14, 0);
flash_txt.autoSize = "left";
flash_txt.border = false;
flash_txt.multiline = false;
flash_txt.wordWrap = false;
flash_txt.textColor = 0x2b5c93;
var ShizFlash:LoadVars = new LoadVars();
ShizFlash.onLoad = function(success:Boolean):Void {
if (success) {
flash_txt.text = ShizFlash.myNews;
} else {
flash_txt.text = "Unable to load external file.";
}
};
ShizFlash.load("http://www.pathto.com/flashtext.txt");
/-------------------------------------------------------/


thanks for any help...

Call External Swf File With A Button
hello people....
How do i call an external swf file with a button ?

Call A Function On The Timeline From External As
i am stuck trying to call a function that is on the timeline from an external .as file. I tried the obvious "_root.functionName();" but to no avail. Any help would keep me from giving up on this crap and going back to as2. thanks in advance.

Making An External Call To Javascript
I am trying to make an external call to Javascript within my HTML page. The Javascript is a cookie that remembers a selection a viewer makes on the web page. I tried writing the Actionscript, but it doesn't seem to work. Does anyone have a clue on how to help. Below is the script I have written:

ExternalInterface.call("javascript-function-name","cookie-name","cookie-value",cookie-duration);
ExternalInterface.call("setCookie","site_addr","we b-address",365);

Please help.

External Interface Call- DESPERATE
Hi, I'm trying to create an HTML splash page that will launch my flash portfolio website- I was told to control the new page with javascript, but when I do so with the code below, my links won't work- see defective link at catmerrick.com, and the page I'm trying to load in a flash-specific window(no back button, etc) at http://catmerrick.com/catpagev.5.html- since it's a portfolio website, it's really important that I be able to create new windows linking to content. I can't tell you how much I would appreciate your help- Thank you so much...

Cat

The code in the swf:
enter_btn.addEventListener(MouseEvent.CLICK, enter2);
function enter2(myevent:MouseEvent):void{
var myurl: String= "catpagev.5.html"
var mywindow:String= "newwindow"
var myfeatures:String= "width=800, height=600, left=80, top=180, toolbar=0, location=0, directories=0, resizable=0"
ExternalInterface.call("openwindow", myurl, mywindow, myfeatures)}

and here is the relevant javascript in the index:

<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<title>cat merrick</title>
<body bgcolor="#ffffff">
<script language="javascript">
function openwindow3 <URL, windowname, windowfeatures>{
window.open<URL, windowname, windowfeatures>
}
</script>

</head>

Call External HTML File?
Hi.

I have a dynamic text field and I would like to call an external html file to be displayed in it.

Anyone have an idea how to do this?

Thank you.

Call External HTML File
Hi.

Can someone please tell me how to pull an HTML file into a dynamic text field inside flash using AS3? Thank you very much. I have not been able to find any tutorials online for this sort of thing. Everything I find is about XML. Thanks in advance.

-Joe

How Call Action From External BTN To Start Ext. MC?
Is it possible?
I load in main SWF an external BTN.
I would like to call loading external SWF over this BTN.

Here is example, what i tried, but no works.

Asfunction Call Inside External .txt
I have an external text file, flashData.txt, that contains data that is loaded into dynamic text fields when main.swf runs. The external .txt contains <a href> calls that work fine if I use them normally (i.e. <a href="contents/arrays1.htm">) but I decided that more functionality was available if I turned the <a href> calls into asfunction calls and used a function to declare my getURL's. That is to say, the code now looks like the following:

Inside flashData.txt:

Code:
&entry0=<a href="asfunction:fetchURL, contents/arrays1.htm">This is a link</a>.&
Inside main.swf:

Code:

function fetchURL(arg) {
getURL("javascript:Launch('"+arg+"', 300, 300)");
}
And the index.htm page containing the main.swf file contains the following script, as presented in Kirupa's Centered Pop-Up Window tutorial:

Code:

<script language="JavaScript">
function Launch(page, width, height) {
OpenWin = this.open(page, "Glider Guides", "toolbar=no, menubar=no ,location=no, scrollbars=yes, resizable=yes, width=" + width + ", height=" + height + ", top=" + (screen.height/2 - height/2) + ", left=" + (screen.width/2 - width/2) + """);
}
</script>
When I run the website using the above code, and click on the link that should, theoretically, call the fetchURL function which will open a new page using javascript, nothing happens. Any suggestions?

If you need to see the current code in action, it can be seen at http://www.gliderguides.com, under the Flash tab on the left, the entry "Working with Arrays", and the link is down the entry a little and named "See The Results Of This Example (arrays1.swf)". Ideally the result of the above code should open a 300x300 bare window containing just the .swf used in the tutorials example.

External Interface.call Question
Hello everyone,
I'm using the ExternalInterface.call method to call a javascript method, which loads a page into a frame. It works in every single freakin' browser except the IE family (IE6,IE7), including MAC browsers. It's pretty simple. The actionscript is:


Code:
var sourceName = ExternalInterface.call("getSource");
this calls the getSource function in javascript, which looks like:


Code:
function getSource() {
var sourceName = top.main.document.getElementById('sourceName').innerHTML;
return sourceName;
//no rocket science here!

}
the sourceName variable is then returned (theoretically) to the actionscript and is used in the following:

Code:
this.getURL(sourceName+"/somepage.html","main");
,which loads the new page into the 'main' frame.

I know here it is a relative URL, and I have tried using absolute URLs to fix this, to no avail. I think that the variable is not getting passed back to the .swf file properly in IE. Does anyone have any experience using the ExternalInterface.call method to communicate with javascript variables? Thanks in advance...

Copyright © 2005-08 www.BigResource.com, All rights reserved