Remote .as File Using #include?
Is it possible to access a remote .as file (from a web url) using the #include statement in flash (AS2)?Tried it and I got the msg: "Include paths must be POSIX-style, and delimited by slashes instead of colons.
Adobe > ActionScript 1 and 2
Posted on: 10/18/2007 09:21:10 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Flash Remoting: Include File NetServices.as: File Not Found.
I am trying to use flash remoting and Flash 8 cannot locate my NetServices.as file or NetDebug file when I test my movie.
The error message I get is as follows:
include file NetServices.as: File not found.
#include "NetServices.as"
include file NetDebug.as: File not found.
#include "NetDebug.as"
Any suggestions?
Understanding Security With Local File To Remote File
First let me explain the setup:
Our company uses a set of talking avatars in lesson Modules to help students learn Math or Writing. Each Course loads in external avatars located on our Avatar server. I have a LocalConnection (technically using SWFBridge) that has the AS3 containers loading in the AS2 version avatars (created from Character Builder by Media Semantics). I can get the LocalConnectionto accurately connect a local version of the avatars in a development environment, however once I try to access the avatars from our Avatar server, the LocalConnection refuses the connection because of the different domains (local vs the avatar server). They both have a LocalConnection, one from the Course to Avatar and vice versa. Also, the Course says it has a sandboxType of localTrusted. The error is a common one:
Code:
*** Security Sandbox Violation ***
Connection to file:///(localFilePath) halted - not permitted from http://(avatarServerPath)/avatar.swf
-- Remote SWFs may not access local files.
The issue is definately because of the Security Sandbox and I have tried : Security.allowDomain("http://(avatarServerPath)"); in the Course, and System.security.allowDomain("*") in the AS2 avatars (which are Flash Player 6) Other attempts included playing with the Publish Settings - Local Playback Security, attempting to set a setting a PolicyFile, and a few others.
I just must be missing a key part of the equation, I know it's just a small fix that I am totally missing the boat on. Any thoughts or assistance is appreciated.
Include& .as File
Hi guys,
I am working on a project where flash does calculations and i have placed the formulas in a .as file and included it in the flash file using the script(#include action.as) It works fine.But when i change the formulas in the .as file and play the swf file it does not reflect the change. For it to reflect the change i need to publish the flash file again. How do i reflect the changes without publishing it again.Like loading a text file and making changes to a text file it will reflect the changes in the swf file without re publishing. Please help guys give me something to work with.
Rohit
What Should A #include File Look Like?
Can some one give me an example of what an #include file should look like using this code:
onClipEvent(load) {
// set initail scale to 100
newscale = 100;
}
onClipEvent(enterFrame) {
if (this._xscale > newscale) {
// shrink
this._xscale -= 10;
this._yscale -= 10;
} else if (this._xscale < newscale) {
// grow
this._xscale += 10;
this._yscale += 10;
}
}
What Should A #include File Look Like?
I have already asked this question but the answer didnt work!
i got this error
scene=Scene 1, Layer=Layer 1, Frame=1: Line 7: Malformed #include directive
#include "D:Acidproofexpand.as";
some one give me a good example on how to use the include function.
here if possible use this sample code!
onClipEvent(load) {
// set initial scale to 100
newscale = 40;
}
onClipEvent(enterFrame) {
// x axis
if (this._xscale > newscale+5) {
// shrink
this._xscale -= 10;
} else if (this._xscale < newscale-5) {
// grow
this._xscale += 10;
}
// y axis
if (this._yscale > newscale+5) {
// shrink
this._yscale -= 20;
} else if (this._yscale < newscale-5) {
// grow
this._yscale += 20;
}
}
Include A .js File
include a .js file
Hi all,
is there a way to include a .js file in flash?
Cause its too hard to code javascript in flash itself.
And the code its really buggy when I try to start it on flash.
this is what I'm trying to do
// :::::::::::::::::::::::::::::::::::::::::::::::::: ::::::::::::::::::::::::::::::::::::::::::::::::::
:::::::::::::::::::::
//::
//::
//:: Script: Amazing Frameless Popup Window - Version I
//::
//:: Functions: In IE4 and later, this script launches a popup
//:: window without the Windows frame or titlebar
//:: (that is, a "containerless" window). In other
//:: browsers, it launches a standard popup window.
//:: Position, width, and height are settable.
//:: Automatic closing of the window on leaving the
//:: page may also be optionally set.
//::
//:: Browsers: IE4 and later
//:: Degrades fully functionally in other browsers
//::
//:: Author: etLux
//::
//::
//::
// :::::::::::::::::::::::::::::::::::::::::::::::::: ::::::::::::::::::::::::::::::::::::::::::::::::::
:::::::::::::::::::::
// Amazing Frameless Popup Window - Version I
// (C) 2000 http://www.CodeLifter.com
// Free for all users, but leave in this header
// set the popup window width and height
runChromeless = function (windowW,windowH,windowX,windowY,urlPop,title,auto close) {
// ============================
// do not edit below this line
// ============================
var popup = "javascriptpenFrameless('";
popup += "s = 'width='+" add windowW add "+',height='+ " add windowH add ";";
popup += "var beIE = document.all?true:false";
popup += "function openFrameless(){";
popup += " if (beIE){";
popup += " NFW = window.open('','popFrameless','fullscreen,'+s)";
popup += " NFW.blur()";
popup += " window.focus()";
popup += " NFW.resizeTo(" add windowW add "," add windowH add ")";
popup += " NFW.moveTo(" add windowX add "," add windowY add ")";
popup += " var frameString=''+";
popup += "'<html>'+";
popup += "'<head>'+";
popup += "'<title>'+ " add title add "+'</title>'+";
popup += "'</head>'+";
popup += "'<frameset rows='/*,0'/ framespacing=0 border=0 frameborder=0>'+";
popup += "'<frame name='/top' src='/'+" add urlPop add "+''/ scrolling=auto>'+";
popup += "'<frame name='/bottom'/ src='/about :blank'/ scrolling='/no'/>'+";
popup += "'</frameset>'+";
popup += "'</html>'";
popup += " NFW.document.open();";
popup += " NFW.document.write(frameString)";
popup += " NFW.document.close()";
popup += " } else {";
popup += " NFW=window.open( " add urlPop add ",'popFrameless','scrollbars,'+s)";
popup += " NFW.blur()";
popup += " window.focus() ";
popup += " NFW.resizeTo("add windowW add ", " add windowH add ")";
popup += " NFW.moveTo("add windowX add "," add windowY add ")";
popup += " } ";
popup += " NFW.focus()";
if (autoclose) {
popup += " if (" add autoclose add "){";
popup += " window.onunload = function(){NFW.close()}";
popup += " }";
}
popup += "}";
popup += "');void(0);";
getURL(popup);
};
thankz all
trolljanz
Include An Avi File
Hi,
I am creating a cd presentation which has a button opening an avi file. But is it possible to open that avi file directly through another application like Windows Media Player from within flash.
In simpler words i want t ocreate a presentation in flash but the avi file should be externally linked and play in another application like Windows Media player.
Please can some genius among u help and guide me through this.
-Avi
#include File.as
Hi,
I am using the following to link it to my main.fla
HTML Code:
#include file.as
I notice that it works with only AS 2 and Flash Player 6.
Is there a way to modify the above line so that It works with newer version of flash player 9.
Thanks
How Do I Include An AS File...
Hi Guys
I have used
PHP Code:
#include 'asfile.as'
But it doesn't work in my sig. Any ideas how I could make it work?
Ta
Benji
.mxp And Include .as File?
When I create a component and create a CS3 .mxp extension through .mxi, mxi containing
<file name="mycomponent.fla" destination="$flash/Components" />
<file name="component.as" destination="$flash/Components" />
i can find neither mycomponent.fla nor component.as on my C:/ disk.
It does show up in CS3 however. BUT......
The component in .fla uses actionscript line
include "component.as";
and when I drag one to a new .fla movie and save it somewhere, the .as file is not saved in the same folder.
Anbody know a solution?
How Do I Include An AS File...
Hi Guys
I have used
PHP Code:
#include 'asfile.as'
But it doesn't work in my sig. Any ideas how I could make it work?
Ta
Benji
How To Include Swf File
Hi,
Someone told me to include swf file all you need is to use the same sytax as you use for jpg just replace with swf file ..i did the following but it does not work..
<td ><img src=Flash/header_1.swf></td>
Thanks
How To Include Swf File
Hi,
Someone told me to include swf file all you need is to use the same sytax as you use for jpg just replace with swf file ..i did the following but it does not work..
<td ><img src=Flash/header_1.swf></td>
Thanks
Getting A .exe File To Log Use On A Remote Server
Let me explain,
I currently design a flash promotional card for a client who regularly sends it out to 100 or so of their clients.
The file is simply an .exe attachment on an email.
While they can measure the email side of things, they want to know if there is any way they can see exactly how many people play the .exe
Thus i am wanting to know if anyone is aware of a way to code some sort of function in action script that will enable this.
Ideally it would gather the users ip and log this info on a remote server or something. (reason for the IP info is simply to eliminate repeat viewing counts - they only want unique views)
Anyone know if this is possible (or ethical for that matter)
Cheers
P
Remote Linking Of PHP File.
Is it possible to run a php from a website on one server from another server?
I have a site that requires a php script, but the very basic hostimng package doesnt support it, so I thought maybe I would put the script on another server that does and reference it from there.
It doesnt seem to be working though..I was wondering, should I keep trying or is this something that cannot be donE?
i cannot see any reason why it shouldnt be possible.
Any help is appreciated on this matter.
Btm, the script is a domain lookup.
How To Add A Picture From Remote File
This is stupid!
I've made a well cool website on flash, but i can't put a picture on it without actually embedding it in flash! lol
I have the loadMovie (pik.jpg, 1); command but i dont know how to use that loaded picture! help!
Remote Flash File
Does anybody know how i can have my menu in a seperate file from the movie, but have the main movie load it?
Uploading Remote .PNG File
Hi all.
I'm trying to bring in a transparent PNG file from a remote server but am having difficulties. I've had no problems using this script and having it work when and if the images are JPEGs.
Here is the script:
stop();
one.loadMovie("./images/Illust1.jpg");
two.loadMovie("./images/Illust2a.png")
Is the problem that flash doesn't allow for remote PNG upload or something else?
Thanks for all your advice/help.
a
Getting A Remote .js File With Flash?
Instead of having the javascript in a .swf, or having the javascript in the page the .swf is in, can I have flash get a remotely defined .js file and execute it's javascript through that?
Calling In Remote MP3 File
Dear All,
Is the are way using Flash and XML to call in a remote MP3 file into a Flash jukebox?
Thanks in Advance for Any Help!
MojoDaddy
Remote File Download
We are writing a flash/air app and are stuck on a download issue.
We have a group of files sitting on a remote directory and we'd like our flash app to download the files and write them to a local directory and then play them from the local directory.
We have the system setup already to play whatever is in the local folder but we don't know if its possible to download and write files to a local directory with actionscript. Any advice would be greatly appreciated.
Does The FLA File Need To Be On The Remote Server
I can't find the information file now, but I seem to remember something about Flash content needing the FLA file to work. Or I'm imagining things, again. So, does the Flash project FLA file need to be uploaded to the remote server?
Thanks,
TW
Trouble With Remote File
Hey Guys
Relative newbie here.
I've created a site that loads external swf's into a holder movie clip using a frame actionscript which is triggered by instantiated buttons that call the function.
Everything tests fine locally but when I upload and test the site only the main swf loads. When the buttons are clicked the other swf files cannot be found. I have checked that all the files are in the correct directory and all seems to be fine.
To see an example of what is happening check the site.
www.thegroomingroom.com.au
The buttons are along the right hand bottom and don't seem to function.
Can anyone explain what might be happening? This has been a problem for quite a while and is really starting to bug me.
Thanks for your time
Leroice
Reading Remote File...
Hey,
Is it possible to get something back from a FileReference.upload() request? What I'm trying to do is have a user upload an MS Excel file, have some php turn it into xml, and get the result back into flash.
I've got the Php working, but I'm struggling to figure out how to get the result back into flash.
Is there any easy way to do this that I'm not finding?
thanks
Include TXT File In A Flash
I havent worked much with flash pages, when iDo use flash i only make animations.
Well, tothe question: How do I include a txt file ?
I work with asp administration updates, databases, but now we shall tothe page in Flash, but the problem comes toupdates and allother texts. It would be gr8 if they could be included into the flash files, but how??
/Micke
Include An External Swf File
I got no clue how to do this. i tried and all i get is the file putted in the top left corner.
i have a mainflash that will be saved as sfw and an animation in another file, swf, and how do i do to include that one???
i use flash4 atm, but some stuff i do in flash5 .. dont like v. 5 interface and its way to work. =)
/Mikey
#include File Question
#include "monVar.as" //(where my include file only has monVar="MyName")
if (monVar=="MyName") {
nextFrame() ;
} else {
stop() ;
}
The above code just works fine with my swf. I also set monVar to anything and my flash program stops.
However, when I tried to take away the include file, my flash program did not stop as in the else clause.
Any suggestion to check if the include file exist and control the program to stop if it is not exist ?
Flash In An Include File
greetings. i'm currently developing a site which utilizes a dynamic web template. when i create a page and try to include the header.asp file (which contains a header.swf file) and preview, all i show is a white space in the dimensions of my flash movie where it should be. there must be something special for using swf files in an include. any help on this would be greatly appreciated. thanks in advance!
Actionscript In Include File
Hi!
It is possible to write the whole actionscript in a file (.txt, .html, or .php) and include it in flash?
Can you give me an exemple?
- Ole Christian
Use A SWF Movie As An Include Instead Of .as File?
Any drawbacks to doing this? You would put your code (that's usually) in an .as file in a movie, compile it, then load that movie. Biggest advantage is that you don't have to re-compile all your fla's if you make one change to the include file. I develop content that could be spread out over 50 seperate fla's so changing an .as has an impact.
Does anyone do this?
Thanks-
Kevin
Include Seperate .as File
this is such a newbie ques, but i have to ask.
in as2, #include "code.as" would allow you to have a separate file for code.
in as3, i understand you have classes, but to how do you apply those classes in a separate .as file? in other words i have a folder for my classes, but if i wanted to have this in a seperate .as file, how would i do that?
thank you
star.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
star.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
star.buttonMode = true;
function mouseDownHandler(evt:Object):void
{
star.startDrag();
star.addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler);
}
function mouseUpHandler(evt:Object):void
{
star.stopDrag();
star.removeEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler);
}
function mouseMoveHandler(evt:Object):void
{
if (star.x > moon.x)
{
star.alpha = 0.4;
}
else
{
star.alpha = 1;
}
}
Question About Include File
I have a Flash movie that calls in an include.as file. I want to be able to edit the script in the include file without having to open Flash.
It works fine when I edit the include file and then testMovie from within Flash. But when I publish it to a SWF and try to edit the include file, the changes to the script do not show up.
I guess my question is does Flash only read include files upon compiling a SWF within the Flash application and not upon loading a SWF in a browser?
Problem With Include File
on one frame i have an include file
#include "hand.as"
at some point of the movie, I will have to go back to this frame but this time flash gets confused because I will be loading the include file for the second time. how do i tell flash not to do so.
pseudocode
if(flash has loaded include file)
{do not reload include file second time}
Include File Id Tags? Possible?
fellow actionscripter,
this may be impossible but i am just curious if an include file is capable to have tags reference much like html id tags.
so in different frames of a movie, can i call the include file using tag reference? Is it possible to call the same include file instead of calling many include as files. Having one include file with many specific tag sections, can save me creating many include tags with only a couple of lines each? Does As files function like html id tags?
Raskolnikov
When To Create An AS File Vs. Just Include AS
Hey folks,
I'm rather new to AS and the heavier "Java-like" coding so I thought that this would be a good question to pose. When do you find yourself opting to create a separate AS file versus just writing the code in a frame in the timeline? Should a class file always be linked to one type of object or should it contain all of th code externally no matter what?
Thanks,
- MT
Include File Question
I am not new to flash, but I have not used it in a while to build out a whole site. Now I have been asked to create a full site in flash but the user does not know flash and wanted to be able to update it without hassleing me.
Is there a way in flash that I could do an include file to an external file like maybe a straight html file or txt file that the person could update, and when flash opens, it will pull the information from the include file and display it on the page. Basically working the same way as a server side include.
If not, any ideas on what I can do to create a full site with maybe 8 sections in there but somehow make the content of those sections easily editable by someone flash illiterate?
Thanks for any suggestions or advise.
Why? Can't Find The #include As File
this could be a super stupid question.
alright, I have downloaded this great xml gallery zip file, when I open the fla file, I saw this line: #include "lmc_tween.as", it's pretty obvious and we all use include a lot for our external *.as files. The thing is, when I try to look for that "lmc_tween.as" in the same directory where teh fla file is, there's nothing there!!!!!!!!!!
And then I tried to remove that include line, as expected, the whole movie just would work.
m sort of freaked out to be honest. anyone know what happen. Is this some kind of trick people use to protect their code?
- mark
Image Locations From Remote Txt File?
Hello! I've got a sticky dilemma I'm trying to sort out.
I've got a dozen movie clips on the stage, and each one of them is loading an JPEG from the server via a loadMovie action in Frame 1. What I'd like to do is create a text file that has all the names of the image locations and then use variables to assign them to the proper movie clips.
For example:
The text file would be something like:
Pic1 = http://www.url.com/image1.jpg
Pic2 = http://www.url.com/image2.jpg
Pic3 = http://www.url.com/image3.jpg
Pic4 = http://www.url.com/image4.jpg
Etc, and so on. I'd like to make it so that the Movie Clip would load the variable "Pic1" and get the image that way.
What I'm trying to do is make it so that I can swap out the images periodically without altering the original Flash file, or overwritng the original images.
Can anybody help? Thanks!
Importing PNG File From Remote Server
Hi all.
I'm trying to bring in a transparent PNG file from a remote server but am having difficulties. I've had no problems using this script and having it work when and if the images are JPEGs.
Here is the script:
stop();
one.loadMovie("./images/Illust1.jpg");
two.loadMovie("./images/Illust2a.png")
Is the problem that flash doesn't allow for remote PNG upload or something else?
Thanks for all your advice/help.
a
Can A Remote SWF Read A Local File?
Can a remote SWF somehow be granted permission to read local files? I know it doesn't work by default. But is there some mechanism whereby users, who trust the remote SWF in question, could permit this to happen?
Should Be An Easy One... Remote File Communication
Hi everyone,
I am pretty basic when it comes to actionscripting and programming so I hope this makes sense.....
When a user clicks a flash 'home' button from within the site I want them to go to the last frame of the index page swf file..rather than have watch it get built again....
This is the site:http://www.maasaieducation.org
I did run a search of the forums - but I don't even know what terminolgy I am looking for!
Many thanks,
M
btw - MX2004
Opera And Remote File Hosting
Hi
bit of a strange one ....I have a streaming mp3 player which plays mp3 s from a remote site due to space requirements.
This arrangement works fine in firefox and IE but when I recently tried using Opera it's a no go....same result in windows and linux.
A flv player using the same arrangement works fine.
Anyone shed any light on this one...opera have gone silent.
mike
example here
http://indogo.org/music/page.php?7
sound player at top.....
Can A Remote SWF Read A Local File?
Can a remote SWF somehow be granted permission to read local files? I know it doesn't work by default. But is there some mechanism whereby users, who trust the remote SWF in question, could permit this to happen? For example, is there a way to digitally sign a
SWF (similar to code signing in Java) which permits this sort of thing?
Desktop Shortcut For Remote (web,ftp) Xml File
Hi,
is it possible to create shortcut for file located in a web (ftp) server? I would like just to click on a shortcut for an xml file located on my server, edit its text, save changes... automatic backup would be also useful, in case of transfer crash.
Is there any utility for that?
Thanx for any tips
P.
Problem With Remote SWF File Loading
I've got a piece of flash software that reads an XML file, builds lists of slides/movies/information to include, and then proceeds to load each of the required bits into a movie clip on the stage. The user can then navigate from one item to another in a number of ways.
All my remote files are located on a single server in a single domain. I have a crossdomain.xml file set up on that server to allow my local swf file to read files from that server.
All seemed to be working well, until I tried an XML file that contains references to .swf files. When the .swf files are supposed to download, the local file hangs and never completes download.
Is there some difference with respect to the security model between a remotely hosted jpg, mp3, flv or other file and remotely hosted swf files? I'm lost in security policy hell here. Any help would be appreciated.
Thanks
Cris
Play Local File Through Remote SWF
Hi,
How a remote SWF file ( downloaded from internet ) , can play a local audio file in browser.
ie. local file is c:music.mp3
In more detail,
For example I have file http:www.a.com/test.swf where it has to play a local audio file c:music.mp3
Error:
Actually when i tries to play the music file it throws the security exception..
And according to application sandbox type.. My application returns me Security.sandboxType = remote..
If anybody have solution of this problem then please help me out.. (j2medevelopersupport@gmail.com)
Thanks in advance..
Mohit Goyal
|