Accessing Files Outside Of Web Root
Is there a way to load a file, specifically audio, from outside of the root web directory? I have audio files placed outside the root so that they cannot be directly accessed through a Web browser. Can Flash do this, or is there a way to use PHP to feed the file into Flash?Thanks.
KirupaForum > Flash > Flash 8 (and earlier)
Posted on: 10-16-2006, 02:37 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Accessing Root From .as
I have searched extensively, so please accept my apologies if this has already been answered.
I am trying to call a function in my main FLA from an .as file. The situation is like this:
Main FLA includes an .as file which itself includes a second .as file:
Main -> .as -> .as
I wish to make the function call from the second .as file but I do not know how to address it. I seem to be able to address other items in the main FLA such as:
Code:
_root.testText.text = "found main from .as";
which works, whereas the following does not:
Code:
_root.testFunction(testVar);
I think I must have missed something very basic, I appreciate any help. Thanks.
Al
Accessing Xml From Root
Hi everyone:
I´m trying to make things with a xml file loaded in as directly in the fla (not with a external class).
I will be fine just with this running:
ActionScript Code:
var xmlData:XML = new XML();
var urlLoader:URLLoader = new URLLoader();
function cargarxml(ruta){
var urlRequest:URLRequest = new URLRequest(ruta);
urlLoader = new URLLoader();
urlLoader.addEventListener(Event.COMPLETE, xmlcompletado);
urlLoader.load(urlRequest);
}
function xmlcompletado(e:Event){
xmlData = new XML(urlLoader.data);
}
cargarxml ("i_01_esp/01_castellano.xml");
//This is what doesn´t run:
trace(xmlData);
Thanks for your help.
Accessing Root
I'm trying to set a movieclip's alpha to 0 when a certain frame is reached in a movieclip that's 2 levels down. Should be easy, but isn't working for me. I've been looking over documentation unsuccessfully. Basically, when frame 30 is reached inside the "loader" movieclip, i want the movieclip "form" on the main stage to go to 0 alpha. I've been trying various lines on frame 30 inside "loader", a couple are below...
Hierarchy = root.mc.loader
1. MovieClip.(root.form).alpha = 0;
2. root.form.alpha = 0;
Accessing The Root Timeline
Hello,
I have a set of buttons that are contained within a movieclip and all I simply want to do it to tell flash to go to a frame on the root time line when a button is pressed.
However, flash will not accept the code (or variations I have tried) as follows:
on (release) {
_root.gotoAndPlay("10");
}
However, this doesn't work and the output window kindly tells me that: "Statement must appear within on handler
_root.onRelease"
Being unexperienced still i'm not sure what that means!
Anyhelp appreciated - I'm sure it's simple!
Thank
Loader Not Accessing Root
Hey,
I have this problem where a Loader load an external .swf, however the loaded content cannot access stuff from the main timeline. I tried root["variableName"] or MovieClip(root).variable, but it won't work. I heard something about _lockroot but it's removed in AS3. How do you access stuff from the main timeline from a loaded .swf?
So...this is what I want:
Main SWF - > Loader.load - > External SWF
External SWF trace "a_text" from 'root' (Main SWF)
Thanks,
GamerFlash
Accessing Root With Addeventlistener
i'm trying to access an object on the root timeline within an addeventlistener that is listening out for a cue point in an flv file. I'm able to trace a response at the cue time so i know the code works but it seems though that i'm not able to access the object - a component with an instance name of buffer.
This is my code:
code:
import fl.video.MetadataEvent;
import flash.display.*;
videoPlayer.addEventListener(
MetadataEvent.CUE_POINT,
function(evt:MetadataEvent):void {
root.buffer.DisplayObject._visible = false;
}
);
and the compiler error is:
Quote:
Access of possibly undefined property buffer through a reference with static type flash.displayisplayObject
where am i going wrong here ?
(been away from actionscript for too long)
thanks.
Accessing Root With Addeventlistener
i'm trying to access an object on the root timeline within an addeventlistener that is listening out for a cue point in an flv file. I'm able to trace a response at the cue time so i know the code works but it seems though that i'm not able to access the object - a component with an instance name of buffer.
This is my code:
ActionScript Code:
import fl.video.MetadataEvent;
import flash.display.*;
videoPlayer.addEventListener(
MetadataEvent.CUE_POINT,
function(evt:MetadataEvent):void {
root.buffer.DisplayObject._visible = false;
}
);
and the compiler error is:
Quote:
Access of possibly undefined property buffer through a reference with static type flash.displayisplayObject
where am i going wrong here ?
(been away from actionscript for too long)
thanks.
Accessing Variables On The Root
Hi Guys,
I loaded an external SWF and I want to access the variables of the main timeline from inside the external SWF. This code didn't work:
Code:
Object(parent.root).soundPath = "../audio/test.mp3";
Thanks
Accessing A Simple Var In Root
Hello All,
I have a question about acessing a variable in root from a external swf loaded with Loader, in AS2 simply do _root.myVar and that´s fine
In AS3 it´s a NIGHTMARE! see the scenario:
ActionScript Code:
//The main SWF -------------
var teste:String = "mizera";
var url:URLRequest = new URLRequest("externo.swf");
var ldr:Loader = new Loader();
ldr.load(url);
addChild(ldr);
//The loaded SWF -------------
trace(teste) // Error: undefined
trace(MovieClip(root).teste) // Error: undefined
trace(MovieClip(_parent).teste) // Error: undefined
trace(root.teste) // Error: undefined
trace(ldr.teste) // Error: undefined
I really dont know how to solve this question, sugestions?
Accessing The Root Of My Clip
Good evening is following, I am finishing a site, and I am inside a movie clip, and within it I have a movie clip that when I clip it has to go to the root, access a movieclip on stage and perform it within a Frame,, I do not know how to access already tried several ways, ... But I do not know how it is because this movie clip is placed on stage with addChild ... I am sorry I rookie lack of knowledge.
The logic is that he has to go in and root access the movie clip loaded with addChild - quadUm within it pgServicos.gotoAndStop (2)
if someone to help me
Accessing Properties Through 'root'.
Within a class that represents 'slide.panel', and is added to the display list, I have code that tries to access a public variable I set in the document class, like so:
Code:
root.satellites.push(sat);
'satellites' is the public variable, of course.
Flash throws the error; 1119: Access of possibly undefined property satellites through a reference with static type flash.displayisplayObject.
I got around this problem by making the public variables static and using 'Main.satellites' (Main being the document class) instead of 'root.satellites' - but I would still like to know what I am doing wrong, if anything? Thanks for any help.
Accessing The Root Of My Clip
Good evening is following, I am finishing a site, and I am inside a movie clip, and within it I have a movie clip that when I clip it has to go to the root, access a movieclip on stage and perform it within a Frame,, I do not know how to access already tried several ways, ... But I do not know how it is because this movie clip is placed on stage with addChild ... I am sorry I rookie lack of knowledge.
The logic is that he has to go in and root access the movie clip loaded with addChild - quadUm within it pgServicos.gotoAndStop (2)
My code in Timeline
Code:
stop();
import fl.transitions.Tween;
import fl.transitions.easing.*;
//variaveis
var objectCom:Number = links.home_quad.quadDesc_mc.height;
var objectComEmp:Number = links.empresa_quad.quadDescEmp_mc.height;
var objectComSer:Number = links.servicos_quad.quadDescSer_mc.height;
var objectComCli:Number = links.clientes_quad.quadDescCli_mc.height;
var objectComPor:Number = links.portfolio_quad.quadDescPor_mc.height;
var objectComCon:Number = links.contato_quad.quadDescCon_mc.height;
//variavel do quadrado um
var quadUm:Um;
// variavel do quadrado dois
var quadDois:Dois;
// frame pega o valor do botão para ir para o frame
var frame:Number;
var frameVideo:Number;
//cria o quadrado um e quadrad dois
quadUm = new Um();
quadDois = new Dois();
//variaveis de posição do quadrado um e dois da tela X
var quadUmX:Number = 250;
var quadDoisX:Number = 490;
//valores dos quadrado um e dois
quadUm.x = quadUmX;
quadDois.x = quadDoisX;
quadUm.y = 210;
quadDois.y = 210;
//fazar a primeira animação
stage.addEventListener(Event.ENTER_FRAME, andar);
//botaum um
links.home.addEventListener(MouseEvent.CLICK, btn);
links.home.addEventListener(MouseEvent.MOUSE_OVER, efeitoOver);
links.home.addEventListener(MouseEvent.MOUSE_OUT, efeitoOut);
//botaum dois
links.empresa.addEventListener(MouseEvent.CLICK, btn2);
links.empresa.addEventListener(MouseEvent.MOUSE_OVER, efeitoOverEmp);
links.empresa.addEventListener(MouseEvent.MOUSE_OUT, efeitoOutEmp);
//botaum tres
links.servicos.addEventListener(MouseEvent.CLICK, btn3);
links.servicos.addEventListener(MouseEvent.MOUSE_OVER, efeitoOverSer);
links.servicos.addEventListener(MouseEvent.MOUSE_OUT, efeitoOutSer);
//botaum quatro
links.clientes.addEventListener(MouseEvent.CLICK, btn4);
links.clientes.addEventListener(MouseEvent.MOUSE_OVER, efeitoOverCli);
links.clientes.addEventListener(MouseEvent.MOUSE_OUT, efeitoOutCli);
links.portfolio.addEventListener(MouseEvent.CLICK, btn5);
links.portfolio.addEventListener(MouseEvent.MOUSE_OVER, efeitoOverPor);
links.portfolio.addEventListener(MouseEvent.MOUSE_OUT, efeitoOutPor);
links.contato.addEventListener(MouseEvent.CLICK, btn6);
links.contato.addEventListener(MouseEvent.MOUSE_OVER, efeitoOverCon);
links.contato.addEventListener(MouseEvent.MOUSE_OUT, efeitoOutCon);
//função do botão um
function btn(event:MouseEvent):void {
stage.addEventListener(Event.ENTER_FRAME, andar2);
frame = 1;
links.gotoAndStop(35);
links.home.gotoAndStop(2);
links.empresa.gotoAndStop(1);
links.servicos.gotoAndStop(1);
links.clientes.gotoAndStop(1);
links.portfolio.gotoAndStop(1);
links.contato.gotoAndStop(1);
}
//função do botão dois
function btn2(event:MouseEvent):void {
stage.addEventListener(Event.ENTER_FRAME, andar2);
frame = 2;
links.gotoAndStop(35);
links.home.gotoAndStop(1);
links.empresa.gotoAndStop(2);
links.servicos.gotoAndStop(1);
links.clientes.gotoAndStop(1);
links.portfolio.gotoAndStop(1);
links.contato.gotoAndStop(1);
}
//função do botão tres
function btn3(event:MouseEvent):void {
stage.addEventListener(Event.ENTER_FRAME, andar2);
frame = 3;
links.gotoAndStop(35);
links.home.gotoAndStop(1);
links.empresa.gotoAndStop(1);
links.servicos.gotoAndStop(2);
links.clientes.gotoAndStop(1);
links.portfolio.gotoAndStop(1);
links.contato.gotoAndStop(1);
}
//função do botão quatro
function btn4(event:MouseEvent):void {
stage.addEventListener(Event.ENTER_FRAME, andar2);
frame = 4;
links.gotoAndStop(35);
links.home.gotoAndStop(1);
links.empresa.gotoAndStop(1);
links.servicos.gotoAndStop(1);
links.clientes.gotoAndStop(2);
links.portfolio.gotoAndStop(1);
links.contato.gotoAndStop(1);
}
function btn5(event:MouseEvent):void {
stage.addEventListener(Event.ENTER_FRAME, andar2);
frame = 5;
links.gotoAndStop(35);
links.home.gotoAndStop(1);
links.empresa.gotoAndStop(1);
links.servicos.gotoAndStop(1);
links.clientes.gotoAndStop(1);
links.portfolio.gotoAndStop(2);
links.contato.gotoAndStop(1);
}
function btn6(event:MouseEvent):void {
stage.addEventListener(Event.ENTER_FRAME, andar2);
frame = 6;
links.gotoAndStop(35);
links.home.gotoAndStop(1);
links.empresa.gotoAndStop(1);
links.servicos.gotoAndStop(1);
links.clientes.gotoAndStop(1);
links.portfolio.gotoAndStop(1);
links.contato.gotoAndStop(2);
}
//função que faz o objeto andar na primeir parte
function andar(event:Event):void {
stage.removeEventListener(Event.ENTER_FRAME,andar2);
addChild(quadUm);// colocar o quadado um no stage
addChild(quadDois);// coloca o quadrado dois no stage
quadUm.x += 15;//faz andar quadrado um de 15 em 15
quadDois.x -= 15;//faz voltar quadrado um de 15 em 15
if (quadUm.x == quadDoisX || quadDois.x == quadUmX) {
stage.removeEventListener(Event.ENTER_FRAME, andar);
}
if (quadDois.x == quadUm.x) {
quadUm.gotoAndStop(frame);
quadDois.gotoAndStop(frame);
fundo_mc.gotoAndStop(frame);
}
}
//função que faz voltar o quadrado apos clicar.
function andar2(event:Event):void {
removeChild(quadUm);// remove do stage
removeChild(quadDois);// remove do stage
addChild(quadDois);// coloca no stage
addChild(quadUm);//coloca no stage
quadDois.x += 15;// andar
quadUm.x -= 15;// volta
//se a condição for verdadeira ele para o andar dois e executa o andar um
if (quadUm.x == quadUmX) {
stage.addEventListener(Event.ENTER_FRAME, andar);
}
}
function efeitoOver(e:MouseEvent):void {
new Tween(links.home_quad.quadDesc_mc,"height",Strong.easeOut,objectCom,objectCom+10,10,false);
}
function efeitoOut(e:MouseEvent):void {
new Tween(links.home_quad.quadDesc_mc,"height",Strong.easeOut,links.home_quad.quadDesc_mc.height,objectCom,10,false);
}
function efeitoOverEmp(e:MouseEvent):void {
new Tween(links.empresa_quad.quadDescEmp_mc,"height",Strong.easeOut,objectComEmp,objectComEmp+10,10,false);
}
function efeitoOutEmp(e:MouseEvent):void {
new Tween(links.empresa_quad.quadDescEmp_mc,"height",Strong.easeOut,links.empresa_quad.quadDescEmp_mc.height,objectComEmp,10,false);
}
function efeitoOverSer(e:MouseEvent):void {
new Tween(links.servicos_quad.quadDescSer_mc,"height",Strong.easeOut,objectComSer,objectComSer+10,10,false);
}
function efeitoOutSer(e:MouseEvent):void {
new Tween(links.servicos_quad.quadDescSer_mc,"height",Strong.easeOut,links.servicos_quad.quadDescSer_mc.height,objectComSer,10,false);
}
function efeitoOverCli(e:MouseEvent):void {
new Tween(links.clientes_quad.quadDescCli_mc,"height",Strong.easeOut,objectComCli,objectComCli+10,10,false);
}
function efeitoOutCli(e:MouseEvent):void {
new Tween(links.clientes_quad.quadDescCli_mc,"height",Strong.easeOut,links.clientes_quad.quadDescCli_mc.height,objectComCli,10,false);
}
function efeitoOverPor(e:MouseEvent):void {
new Tween(links.portfolio_quad.quadDescPor_mc,"height",Strong.easeOut,objectComPor,objectComPor+10,10,false);
}
function efeitoOutPor(e:MouseEvent):void {
new Tween(links.portfolio_quad.quadDescPor_mc,"height",Strong.easeOut,links.portfolio_quad.quadDescPor_mc.height,objectComPor,10,false);
}
function efeitoOverCon(e:MouseEvent):void {
new Tween(links.contato_quad.quadDescCon_mc,"height",Strong.easeOut,objectComCon,objectComCon+10,10,false);
}
function efeitoOutCon(e:MouseEvent):void {
new Tween(links.contato_quad.quadDescCon_mc,"height",Strong.easeOut,links.contato_quad.quadDescCon_mc.height,objectComPor,10,false);
}
links.home.buttonMode = true;
links.empresa.buttonMode = true;
links.servicos.buttonMode = true;
links.clientes.buttonMode = true;
links.portfolio.buttonMode = true;
links.contato.buttonMode = true;
quadUm.videoMaquina.buttonMode = true;
my code into MovieClip quadDois
Code:
fotolito.addEventListener(MouseEvent.MOUSE_OVER, servOver);
fotolito.addEventListener(MouseEvent.MOUSE_OUT, servOut);
fotolito.addEventListener(MouseEvent.MOUSE_OUT, servClick);
gravacao.addEventListener(MouseEvent.MOUSE_OVER, servOver);
gravacao.addEventListener(MouseEvent.MOUSE_OUT, servOut);
estLocalizada.addEventListener(MouseEvent.MOUSE_OVER, servOver);
estLocalizada.addEventListener(MouseEvent.MOUSE_OUT, servOut);
estFrontal.addEventListener(MouseEvent.MOUSE_OVER, servOver);
estFrontal.addEventListener(MouseEvent.MOUSE_OUT, servOut);
maquinaCarrosel.addEventListener(MouseEvent.MOUSE_OVER, servOver);
maquinaCarrosel.addEventListener(MouseEvent.MOUSE_OUT, servOut);
aerografo.addEventListener(MouseEvent.MOUSE_OVER, servOver);
aerografo.addEventListener(MouseEvent.MOUSE_OUT, servOut);
prensa.addEventListener(MouseEvent.MOUSE_OVER, servOver);
prensa.addEventListener(MouseEvent.MOUSE_OUT, servOut);
function servOver(e:Event):void
{
var nome:String = e.currentTarget.name;
linksServ_mc.gotoAndStop(nome);
servCirculo.sergira_mc.alpha = 0.5;
}
function servOut(e:Event):void
{
linksServ_mc.gotoAndStop(1);
servCirculo.sergira_mc.alpha = 1;
}
function servClick(e:Event):void
{
root.quadUm.pgServicos.gotoAndStop(2);
}
error: 1119: Access of possibly undefined property quadUm through a reference with static type flash.displayisplayObject.
thanks
Accessing Root For .as File
I have searched extensively, so please accept my apologies if this has already been answered.
I am trying to call a function in my main FLA from an .as file. The situation is like this:
Main FLA includes an .as file which itself includes a second .as file:
Main -> .as -> .as
I wish to make the function call from the second .as file but I do not know how to address it. I seem to be able to address other items in the main FLA such as:
Code:
_root.testText.text = "found main from .as";
which works, whereas the following does not:
Code:
_root.testFunction(testVar);
I think I must have missed something very basic, I appreciate any help. Thanks.
Al
Accessing .txt-file Outside Web Root
Howdy!
I want to store a .txt-file containing a password outside the web root, so it´s only accessible from a swf residing on the same server, but in the web directory. Is this possible?
I´m thinking something like (in the swf):
lv.load("C:\textfile.txt");
But I´m having no luck :P
Accessing The Root Timeline.
Hello,
I have a set of buttons that are contained within a movieclip and all I simply want to do it to tell flash to go to a frame on the root time line when a button is pressed.
However, flash will not accept the code (or variations I have tried) as follows:
on (release) {
_root.gotoAndPlay("10");
}
However, this doesn't work and the output window kindly tells me that: "Statement must appear within on handler
_root.onRelease"
Being new i'm not sure what that means!
Anyhelp appreciated - I'm sure it's simple!
Thanks.
Accessing Variables From Movieclip To Root?
Hello!
I've got a simple question.
I have a movie that loads a global variable in the first frame in level0 (root),
I've also have a movieclip loaded on the stage that holds 3 buttons
i want to access the global variable from within the movieclip and change it.
How do i do that?
Accessing Root Flashvars From External Swf
Hey all, I'm in a bit of a pickle.
I have two AS3 swfs. The one - a movie player - accepts flash vars, and works fine. It then calls a second swf to skin itself. This second swf also takes flashvars.
I am trying to make the second swf - the skin - reach into the parent root to get at those flashvars. In AS2 its easy - _root.myVar will do the trick. Unfortunately this doesn't work anymore.
To make things more complicated, I have yet another swf that sits before everything - it basically checks the Flash version of the user, and loads an appropriate file (either Flash 8 or Flash 9). This 'loader' swf is what accepts the flashvars, and then passes them along. however, I think this is working fine, so I don't think that's the problem.
I'm new to AS3 and I've been confused by most of what's out there. Do I have to make my own class and do all that just to access these flashvars?
Thanks for your help
Accessing A Text Box In A Movieclip From Root
Hey,
I'm trying to change the text on a textbox called "text1" that is part of a movieclip called "menulist" using actionscript. How can I access text1 with actionscript?
Here is what I have so far:
Code:
menulist = attachMovie("menu","menulist",10);
menulist._x = 300;
menulist._y = 50;
menulist.mc.text1.text = "blah blah blah";
Accessing Variables On The Root Timeline?
I have some variables declared on the root timeline that I need to access from some MovieClips. In AS2 I would do something like this _parent.myVar from within my MovieClip. I intend on getting fully up to speed with AS3 but right now I need a quick fix. Help anyone?
on the root timeline I have a variable : var myHitTest:Boolean = false;
My MovieClip needs to access this var so I tried it several ways listed here. I've had no success.
parent.myHitTest:Boolean
root.myHitTest:Boolean
Stage.myHitTest:Boolean
stage.myHitTest:Boolean
parent.myHitTest
root.myHitTest
Stage.myHitTest
stage.myHitTest
(parent as MovieClip).myHitTest:Boolean
(root as MovieClip).myHitTest:Boolean
Stage.myHitTest:Boolean
stage.myHitTest:Boolean
Accessing Movieclip At Root From Class ?
I cannot access any movieclip(or anything else) on the stage/root from inside class codes :
ActionScript Code:
package mypack {
import flash.display.MovieClip;
public class MyClass extends MovieClip {
public function MyClass () {
trace(root.myMC); // COMPILE ERROR = 1119: Access of possibly undefined property myMC through a reference with static type flash.display:DisplayObject.
}
}
}
Why is that ?
Accessing Root Timeline Button
Hi,
I think this is a fairly basic thing to do, but I can't seem to figure it out. I have a movie clip(mc1) with a button(btn1) and a movie clip(mc2) in it. The button plays this second embedded movie clip(mc2). In this second movie clip(mc2), I have a button(btn2) that, when clicked, I would like to cause the first button(btn1) (on the root timeline) to disappear. Is this possible, and if so, could you help me figure out how to do so?
Thank you,
Brad
EDIT: Just so its easier to visualize, here's a hierarchy of the relevant elements:
mc1
-------btn1
-------mc2
-------------btn2
Edited: 10/30/2008 at 09:49:28 AM by bathkbra000
Accessing Variables From A Root Class
I am working with the basics on getting accustomed to AS3 and working in classes. Normally, I use a lot of functions called up from the root. The class structure is appealing, but I am having a tough time with some of the things that I normally do. -One of which is to have a _root or _global variable to hold preferences (such as an audio toggle or volume). For storing session preferences that extend throughout the scope of a Flash site/app, these are preferred. Well...as you are aware, the _root and _global variables are no more. I have done a lot of research into this and I think I am close to a solution, but perhaps my syntax is off.
source: http://www.exade.com/temp/testGlobal.zip
On the root timeline, I call the class (works) and then trace it out (also works). According to this script, which is modified from http://www.kirupa.com/forum/showthread.php?p=2110830, I can use this to create a pseudo glo.bal variable. However, when I run the SAME trace function (that works on the main timeline) from within a movie clip -it fails. "Access of undefined property glo"
NOW, if I import the class into the movie clip and run the trace from that movie clip, -it works. However, this doesn't help because I am trying to store a variable that works across the entire scope of a file; not intiate a new instance of this variable for every timeline in the scope of a site. I want to initiate it once and change it from any timeline or script -globally.
Perhaps I am going about this all wrong. Therefore, if it can be pulled off a different way, the end is still the same. -I need a toggle switch(es) that can hold settings across ALL timelines and movie clips in a Flash file.
Thanks in advance!
Attach Code
package com.virion.as3.common{
public class glo {
public static var bal:Object = new Object();
if (glo.bal.testVar == undefined) {
glo.bal.testVar = true;
}
}
}
Accessing Properties Of A Component In An MC From The Root
I have a button component "runCalc_button" labeled "Caclulate" within a movie Clip "inputScreen_mc".
I'm trying to access the button's properties from the Root, but I'm getting back "undefined."
Here's my code:
Code:
_root.attachMovie("inputScreen_mc", "inputScreen_mc", 200);
trace(_root.inputScreen_mc.runCalc_button);
trace(_root.inputScreen_mc.runCalc_button.label);
the first "trace" returns "_level0.inputScreen_mc.runCalc_button" as it should.
the second returns "undefined."
Anyone know why? Shouldn't it return "Calculate."
Accessing Functions On The Root Timeline
What I have is a movieclip that is nested within a movieclip on my main stage.
My question is, is there a way that I can access a function that is written on my root stage from within that movieclip?
In AS2 all you had to do was something like
Code:
_root.myFunction();
And that was it. Not the case in 3.0??
Is there a quick solution?
-Carmire
Accessing Unknown Variables In The Root
If flash is passed a lot of unknown variables (via yourflash.swf?unknownvar=1&unkownvar=2& etc) Is there an easy way parse through ALL that info in the _root?
In order to append it to a getURL call later in the flash.
[Flash5] Accessing Root Variables From Places..
hey all, looking for a bit of help with this problem..
at the moment I have a main *.swf (base.swf) which other movies get loaded into as theyre needed, into a box called 'pan'. Inside the other movies I have buttons, which have a Movie Clip on the first frame, and a static image (the same as the movie clip) on the other 4.
Now, I want the movie clip on the first frame, to only be visible if a root variable '_root.shs' is set to true, so I put this in the Movie Clip inside the button
Quote:
onClipEvent (enterFrame) {
this._visible = _root.shs;
}
however, no matter what the visibility is on (even though Im changing it around and setting it to false), it doesnt register it (after using the trace() command, its not returning anything, though if I use the excact same trace command on the frame of base.swf then it returns the correct values).
Any way to get around this at all, or at least get the movie clip finding the variable?
[CS3] Accessing Variable On Root Timeline From Within A Symbol
I have a simple Boolean variable in the first frame of my root timeline that I would like to access/change from within a symbol. Can't figure it out for the life of me. I'd like to stay away from using a package if possible. Any help is much appreciated!
ArgumentError: Error #2025, Accessing Root
Well... yet another thing I've found with AS3 that makes it a pain in the butt. APPARENTLY you can't access root from within a class that is in a child of root.
ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
at flash.display :: DisplayObjectContainer/removeChild()
at thumbnail/ :: removeLargeImage()
at thumbnail/ :: onClickLargeView()
I cannot program this without removing the child of a parent object, something that the Flash compiler apparently prevents you from doing. My code is a simple root.removeChild(...);, but it throws that error every time. How would I get around this limitation to remove a movie clip from root? I've tried this.root.removeChild, but it failed the same way. (I didn't expect it to work, but I gave it a try.)
I'd love help on this, I'm making a website for my dad's friend. Thanks!
(Edited to get rid of the smilies in the argument error.)
Accessing A Root Variable From A Movie Clip
Hey all - pretty new to Flash here, so hope ya don't mind helping with some (hopefully) easy questions.
I made a variable in my root timeline, and want to be able to access it from a movie clip.
In the root: var chapterframe:int;
In my movie clip: MovieClip(parent).gotoAndPlay(5)
I would like to replace the number 5 with the value of the variable chapterframe, but well... I've tried several things, but nothing works. Any suggestions?
Thanks,
~ Nick
Trouble Accessing Variables From Root In Loaded Swf - AS3
I've searched the forums for days now and can't seem to figure this out. I'm building a flash site using AS3 that loads the individual pages into a single movie. The problem I'm having is I can't get the loaded swf to see variables that are set in the root movie.
For example... The site is for a construction company and I've created a dynamic image gallery. The gallery is divided into different catagories (embassies, churches, commercial, etc...) and the user chooses one of those catagories from the XML generated main menu located in the root movie. That loads the image gallery page into the root movie. The image gallery should then call a php page which returns the selected catagory from my database. I can't figure out how to get the gallery swf that was loaded into the root movie to know which catagory it should send to the php page.
I'm trying to set a variable when catagory is selected, "returncatagory.php?catagory=churches" for example, and have the image gallery use that for its URL request.
Any thoughts????
Accessing Root Variable From A Class File.
I have a Movie clip class named MY_MC,
and would like to access to root level variable.
fla timeline
Code:
var Status:String = "ok";
MY_MC.as
Code:
package{
import flash.display.MovieClip;
import flash.events.Event;
import flash.events.MouseEvent;
public class MY_MC extends MovieClip {
public function MY_MC() {
trace(Status); // here I am trying to access.
this.addEventListener(MouseEvent.MOUSE_OVER,lampOn);
}
private function lampOn(e:MouseEvent):void
{
trace("OVER");
}
}
}
How Can I do this?
Thank you.
Accessing Root Variables From A Class File.
I have a Movie clip class named MY_MC,
and would like to access to root level variable.
fla timeline
Code:
var Status:String = "ok";
MY_MC.as
Code:
package{
import flash.display.MovieClip;
import flash.events.Event;
import flash.events.MouseEvent;
public class MY_MC extends MovieClip {
public function MY_MC() {
trace(Status); // here I am trying to access.
this.addEventListener(MouseEvent.MOUSE_OVER,lampOn);
}
private function lampOn(e:MouseEvent):void
{
trace("OVER");
}
}
}
How Can I do this?
Thank you.
Accessing Root Variables From A Class File.
I have a Movie clip class named MY_MC,
and would like to access to root level variable.
fla timeline
Code:
var Status:String = "ok";
MY_MC.as
Code:
package{
import flash.display.MovieClip;
import flash.events.Event;
import flash.events.MouseEvent;
public class MY_MC extends MovieClip {
public function MY_MC() {
trace(Status); // here I am trying to access.
this.addEventListener(MouseEvent.MOUSE_OVER,lampOn);
}
private function lampOn(e:MouseEvent):void
{
trace("OVER");
}
}
}
How Can I do this?
Thank you.
Dyn. Text In Movieclip, Accessing The Variable On Root Buttons
I have 9 buttons on the main timeline of a movie, and when mousing over, they all play the same graphical movieclip called overPanel, in which are two dynamic textfields called 'services' and 'products'.
OnMouseover, I want each button to add it's own words for the two fields, but I can't access them because they're not on the main timeline. I know MX can do this, I just don't know how to target them (I suck at targetting in general).
I can get it to work fine if I put textfield with the var name 'service'into the main timeline using the following basic code in the button, but I can't figure out how to target a textfield named 'service' on the main timeline buttons when it's in my overPanel Movie:
on (rollOver){
service="FORUMS"
}
on (rollOut){
service=""
}
works when the textfield is on the main timeline with the button.
I've tried:
_root.overPanel.service="blah"
_root.overPanel.servicetext.service="blah" (servicetext is the instance name of the textfield in overPanel mc)
_service="blah"
_overPanel.service="blah"
_overPanel.servicetext.service="blah"
in place of the 'service="etc."' in the line that works when it's on the main timeline.
None work.
Yucki phoo phoo.
Obviously missing something basic here...
Shawn
Can Flash Access Files Outside Of The Web Root
Hi Guys,
Is there a way for flash to load files (images) outside the web root folder
of a website. The reason I want to do that is to prevent the users from
downloading the image files.
Thanks a lot!
External Files Outside The Flash Root
Hi,
I am having a problem linking to an external xml file and an external css file. The files are outside the flash folder.
This is my dir structure.
root-
|
->flash
|
->shared-
| |
| ->xml-
| | |
| | ->test.xml
| |
| ->classes
|
|->template-
| |
| -> style.css
This is my code:
PHP Code:
testStyle.load("../template/style.css");
and
PHP Code:
testContent.load("../shared/xml/test.xml");
Can any one point out where im going wrong in this path.
Thanks in advance
Accessing Movie On Root While Inside A Movie
I am new to flash
I am working on flash 8.
I want to know that
i have two movies on the ground panel . i have placed one button in one movie . when i click that button i want to set other movie's alpha =0 that is placed on the root.
Beginner (but Not) Questions: AS Files, ROOT Size, Layering...
Quote:
Originally Posted by Forum Quote
This is a forum for very new users to flash, there is no such thing as a stupid question in here.
All right... with the above in mind...
I have a couple questions...
First off, I have 10+ years experience programming...
PHP, Visual Basic, Java, as well as some scripting experience...
So I understand OOP, Classes, etc...
My problem is...
I can't figure out where to load this stuff in a flash movie...?
If I wanted to create a boardgame.
Where I had maps, characters, items, terrain, etc...
Would the ROOT movie be a single frame movie with Movie Clips of all the elements included on Layers or added as an Import option?
Where would I include classes? I understand you can create AS files, but when I upload the final game to the server? How do I make sure the AS files are included?
I was thinking that I would create classes to handle EVERYTHING...
Create a Game Class that handled each game.
... a Map Class that managed the maps...
... a Terrain Class that managed Terrain for the Maps...
... a Unit Class that handled adding and removing Units from the Maps...
... Maybe a Player Class that handled all the player manipulations...
But I don't really know where to begin.
I have a GREAT book on Flash MX 2004 Professional Actionscripting...
It made it very clear HOW to create AS files, and the syntax for creating my own custom classes... but nothing on WHERE to place this stuff... and/or what would OVERLOAD the Flash System when it came to players and maybe even MULTIPLAYERS...
I am new to Flash but not to programming... Hopefully someone can help me out. I would gladly accept URLs for decent tutorials for the above stuff as well. Thanks in advance...
HELP I Renamed My Root Folder, And Need To Regain Access To My Files
Please help! Ever since I renamed my root folder, I haven't been able to access my flash file I've been working on all day!!... When I revise the file and publish it, what plays is the previously saved version (I thought I was going nuts)... Can anyone tell me what i can do to regain access to my files??
Accessing CD Rom Files
Can anyone help with this?
I have a project which was done using Flash MX (Projector). I am planning on using an installer to load this .exe and the larger files (video, animation, etc.)to the hard drive then launch the program. I need the application to also access the smaller files stored on the cd. How do I get access to the CD rom since the drive letter could be different on many computers.
Any help would be greatly appreciated.
lorni
Accessing ASO Files.
I'm working on an auxilary class for collision detection at the moment. Like most precise collision detection methods, it suffers a bit in fps. The approach I'm taking is using ByteArrays, but I think I could speed it up considerably and still have precise detection. Only problem is I need access to an intrinsic class (BitmapData). I don't want to change the class - just retrieve some of the code from one of its methods and add the necessary bits I need in my own class.
From what I've seen when trying to track down the class, it's mostly stored in an ASO file. It's nicely obfuscated, and I'm not terribly interested in going in and cleaning it up by hand so I can work with it. Does anyone know of a relatively painless way of working w/ these files?
EDIT - Disregard. I've worked out code of my own that takes a different approach from what I originally planned on doing. Happy to say it works rather efficiently, and I won't be needing access to the intrinsic Adobe classes.
Help Accessing Cd Files
I have a project that is accessing files from a cd. iam using the get url action i.e.
on (press) {getURL ("files/xxx.pdf","_blank");}
when i try to access the files from the cd i created it will not open them unless i have a browser open already, if not it just hangs.
Anyone encountered this one before. If so, please advise.
Thanks in advance
Visual1
("The only difference between me and a madman, is that I am not mad") Dali
Accessing Variables From Txt.files?
I cant seem to use the variable that I get from my txt file. The right number from the txt is being placed in the textfield where I want to store it but when I try and transfer that variable I have no luck.
// this line gets the right number and transfers it into a text field called totalRiders
loadVariables("numberOfRiders.txt", "");
//this is where the problem occurs. It wont let me transfer the number from totalRiders into the test text field.
test = totalRiders;
Please help me. Its driving me crazy.
Accessing Metadata From Mp3 Files
hello guys!... i was using the id3 property and well i want to get the genre after it loads the mp3 but it just returns a number, instead of returning say Rap it returns 15, is there any list associated with this?... any ideas?
Accessing Text Files
I am writing an swf to run on my computer (perhaps as an exe, I am not sure yet). Is it possible to create and access text files using actionscript?
I plan to use LoadVars to get information from a mySQL database (through a php file on my site) and then store this information in a text file (with "|" separating fields and "||" separating lines);
So, really, all I need to know how to do is create a text file that stores 1 variable.
Thnx
Accessing Functions In .fla From .as Files
I was wondering if there is a way to access functions and variables that are defined in .fla, on some scene/layer´s actions, from a custom made class.
for example, if i have a variable var object:Array() defined in Scene 1--Layer
how can i access this variable from custom class .as file.
Accessing One SharedObject From 2 Swf Files
Hi. I was wondering how i would go about accessing a shared object from two different swf files. do i just declare it in both swfs? do i need to use _root or whatever in one swf and not in the other?
Thanks.
MJ
|