Referencing Varible In Root From MC?
Mar 28, 2009I have a varible in my root
Code:
place = "1";
i want to refence it in one of my MCs so that i can run a statement like this:
[code]....
I have a varible in my root
Code:
place = "1";
i want to refence it in one of my MCs so that i can run a statement like this:
[code]....
I am having trouble dynamically changing the reference to root in my movies. Here's what I'm trying to do: I have a main movie(_level0.mainMovie) that I am loading external .swfs into. However, I want to be able to test the child movie clips without having to load them into the mainMovie(for testing purposes). In such a case, the child clip would be at _level0 or _root. I would like to add some code to the child clips to test whether they are the _level0 clip, if not, then I want to change their reference to _root. Here's what I've come up with, which doesn't seem to work:
Code:
function testLevel(){
//This code goes into each child clip to see if it has been loaded into another clip
trace(this);
if(this == _level0){ //If this is the _level0 clip
[code]....
dynamically loaded swf files that employ .root syntax. I'm loading in several older swf files into a master swf. The master has a previewer that lets the user preview the library of swf files. Some of these older swf files have buttons in them that use .root, and I don't want the .root to effect the master swf, but the loaded one.
View 5 RepliesI have a root timeline in which contains a movie clip on a certain frame. Inside that movieclip, on it's second frame, there is a button. I would like to use this button, when clicked, to move take the user to a frame on the root timeline.
View 5 RepliesI have a movieclip "submenu" that is on the main timeline, and inside this movieclip, I have some ActionScript:
[Code]....
I have a 13 movieclips within another movieclip which in turn is placed on the root timeline. I have written a function in the actions layer of the main timeline:
function illboxClear(){
_root.illpre.ill1.gotoAndStop(1);
_root.illpre.ill2.gotoAndStop(1);
_root.illpre.ill3.gotoAndStop(1);
_root.illpre.ill4.gotoAndStop(1);
[Code] .....
It sends the animation in each of those described movieclips back to frame one as you can see. When I try to call the function from actions on a button which itself within a separate movieclip placed on the stage:
on (rollOver) {
illboxClear();
_root.illpre.ill2.play()
} on (rollOut) {
_root.illpre.ill2.play()
} on (release) {getURL("boxer.html","_blank");
}
It doesn't work! Can I not call functions from button objects or have I made some other elementary error?
I'm trying to reference the document object from various classes in my class library. Everything seemed to be going peachy until I started getting this random, weird error. I thought maybe it was Flash acting up all of a sudden but I tried it on my Mac as well and I get the same error. Basically no matter WHAT I do, I am getting the error:
1195: Attempted access of inaccessible method getSessionHandler through a reference with static type pim:PClient
It's a lot of code, but here is the full code.
// PClient.as
package pim {
import flash.display.MovieClip;
import pim.gui.PGConsole;
import pim.loader.PCommandLoader;
[Code] .....
Alright so right now, I have sort of a singleton reference that I'm using so I can reference the document object from any class (without the need to pass the client object to each class that needs to use it). I'm pretty sure I've done this before and had it work, but obviously it is not. I've even tried passing the client object (this) to the PCommandLoader object and it still gives this really strange error (that is without the use of any static methods, etc.).
I've tried everything -- even a class that holds the PClient object reference, which was really messy -- and it still gives this really, really weird message. Even referencing the root property on movieclips gives me this error. The movie was working great and then magically it started doing this. I backed everything up and undid everything back to pretty much empty script files and it wouldn't let me compile since...
How do I reference the root frame label in a function for event dispatching using a switch statement.
SUMMARY: This is simple, but as I've stepped away from ActionScript for too long, I'm having trouble figuring out the proper test expression to reference the root timeline frame label (e.g., switch(the root frame label)).
Nothing i've tried works:
switch(this.label)://obviously this would look at the button timeline switch(event.root.label)://player says there is no "root" property ...
STRUCTURE: I have five MCs, one on each of five frames. I have a forward button and a back button. I created a switch statement to specify different actions, based on the root frame label. Frame labels are f1, f2, f3, f4, fend.
THE RELEVANT CODE on Frame one ("f1"):
Code:
stop();
nexter.addEventListener(MouseEvent.CLICK, onNexter);
nexter.buttonMode = true;
[Code]...
in flash.net.FileReference;
public class FileDownload {
private var DOWNLOAD_URL:String = " ";
i need to set up a varible string.How do I do that?
I'm attempting to get a variable to be displayed on a screen by the use of dynamic text thats been linked to a variable via the properties menu. The variable however is attached to a move clip and is within an onClipEvent.For some reason I can only get the varible to be displayed by putting it on a frame. So is there anyway i can get a varible to be displayed that is within a MC or can I use a command in that MC to change a varible thats stored in a frame?
View 2 RepliesI have an input text box, and a data.txt file containing data:[code]And I want, when i input 32, to display in two dynamic text boxes: "Ana" and "L". hope there is an easy way without using php and complex databases.
View 1 RepliesI want to make the link a variable so I can pass a few URL's into this.[url]...
View 1 Repliesi have a page on my website that reads variables from a text file and imports them into dynamic textbox. Everything works great when i run the page or stage by itself but when i run the website from index and go to that page, the output i get for the text fields is "level0.StoredA" .my code is, as follows on the frame.
loadVariablesNum("rates.txt",0);
I have made my project in diffrent flash files but now i m stuck to get data from child.swf to index.swf.
View 6 RepliesIt might sound confusing so let me explain the situation. I made a movieClip. And in that movieClip I have a dynamic textfield set. I called this textfield "AmmoCount".I dragged this movieClip onto the stage several times and each time I called on the AmmoCount varible in each movieclip and gave it a different value. I get the following error TypeError: Error #1009: Cannot access a property or method of a null object reference.[code]
When I trace these objects, weapon1.AmmoCount works, but weapon2.AmmoCount shows as empty. Yet they both contain a value in them. Ive used the weapon1 property and weapon2 property countless times and there is no doubt that it works. so why doesnt it work for weapon2. but for weapon1. Below is some code that I called on earlier that shows they work.[code]these worked! but when I called on the AmmoCount text box within them, I get the error. The following image you can find within the weapon1 movieClip
I am putting together an artists gallery, and i need to show each artist's collection when you select their name from a drop down combo box. [url]...
create a new xml file for every artist (artistname.xml) to load in to the thumbnail gallery.
QUESTION - How do I make this file to be a variable depending on the user selection from the dropdown.[code]...
a varible is declared and initialized on main stage. how do you access this varible through a symbol? i.e while you are editing the symbol..
a varible is declared and initialized on a symbol. how do you access this varible on main stage? i.e. while you are in main...this is confusing little, but,
Situation:
- We have a Flash application located on a SAP EP (let's say ep.x.com)
- We have a SAP ABAP Application (Webservices) on a SAP WebAS
server (abap.x.com)
- Clarification: This is not about Flash islands / but a normal Flash application communicating with WebAS ABAP via WebServices
Problem: Due to the changed security policy in Flash 10 this scenario does no longer work.
- A crossdomain policy file on root level cannot be deployed on root level
- The WebServices http/s headers cannot be modified, since the WebServices are generated by the WebAS IDE.
Comment: Technically there is a way to patch a WebAS ABAP,but this is not a practical / acceptable way in a normal SAP WebAS infrastructure.
Conclusion:- The above scenario (Flash from EP content / WebAS ABAP as backend) is a quite normal scenario in the SAP world.
- SAP / Adobe always features the close relationship between their technologies.
Question:- What could we do?
- How does the Visual Composer works around that problem?
I have a root stage, and a MC that is called from the root stage.Now from that MC, i will called in another MC2, and I wanted to placed the MC in the center of the stage. The reason I could not use normal ADDED_TO_STAGE at MC and define the center is because MC is not place in the exact position of the root stage (as in x, y=0). So if I would target MC2 at MC stage center, it would not be the exact center of the root stage/screen.How can I called the root stage properties rather than adding MC2 into the stage?
View 1 RepliesHow do you tell the root timeline to root.gotoAndStop(2); from the timeline of a movieClip added using addChild?In the maintime line I have
addChild(fade_eng);
and in fade_eng I have the following on frame 20
root.gotoAndStop(2);
this.gotoAndStop(1);
But I am getting 1061: Call to a possibly undefined method gotoAndStop through a reference with static type flash.display:Stage.
basically i was trying to make a program execute on the web, but it needs to load in pictures and since i didnt want to make the file size massive i converted where the images would show into a movie clip and used the loadMovie(pathname) procedure (im using AS2) to link the files, it works obviously when i test run it. in the pathname section i have "images/pic1.jpg" and so on for the different pictures as a tutorial i followed lead me to believe that it would find the pathname the program is running from and add the suffix images/pic.... etc to find the picture.
the problem is when i run it on the web its still trying to find the files on my computer, even though there is no part of the code that tells it to look in my documents/folders etc. even when i tried to link the file exactly, so put in oadMovieMy question is why is it still trying to find my local document folders instead of looking at its own run source on the internet. is there a way of absolutely linking it to the images i have now on the internet instead?
I'm trying to read an XML file with actionscript 2.0
The problem is I can only make my code to read a value of a tag by referencing their position.
e.g.
var currentIcon = myXML.firstChild.firstChild.childNodes[0].firstChild;
How do I retrieve a value from an XMl file by referencing their tag name?
e.g.
var currentIcon = myXML.firstChild.firstChild.childNodes['icon'].firstChild;
Here is my XML file...
<weather>
<current>
<icon>Partly cloudy</icon>
[Code]....
I have a process set up to create action script files. They hold functions that are called upon by my flash project. How can i reference these files so that the project knows the functions are there. with asp.net i would simply reference the .js file. Is it the same process?
View 1 RepliesI've got another problem (similar to my last), although this time it's movie clip names, rather than variables.[code]I've created some movieclips as such ^ so for each user there are 2 empty movie clips, and now I'm trying to reference to these movie clips, but am having some trouble in doing that, for example:[code]While the last one doesn't bring any errors, it still doesn't seem to work.[code]
View 9 RepliesHow do you reference and already existing object in as3? My below program draws 2 circles and a line to connect the two. The circles and the line are all individual objects. The line (connector class) has a function called update that should redraw the line between the two circles. It has two variables which I want to be the references to the two circles. The circles (coolcircle class) has a variable which I want to be the reference to the connector. It doesn't seem like my update() function is getting called.
ActionScript Code:
package
{
[code]......
I wish to pass a reference to _camera.y, but _camera.y is a primitive and gets passed as a value.Here's the code for a little debugging class.
ActionScript Code:
package
{
import flash.events.Event;[code]..........
If I call watch("Cam Y", _camera.y) I get "0" traced out all the time - I assume because the y position of the camera is being passed in as a value.I want to pass it in as a reference so that this little class will keep an eye on the y position of the camera.
I made the mistake of purchasing one of those flash template sites. I have most of it customized, however I need to flip between gallery images when the user selects the menu item. how to reference one element from another... I need the release event of the menu item (which i already have stubbed out, to trigger a tweenMenu function call... however, I don't know how to get the path of the argument to pass the object to the tweenMenu function call.
I need to make this call (in theory)
tweenMenu2(_root.gall, _root.xkoord[(_root.small-1)] );
however, the path to gall is:
_level0.instance146.gall
how i would make the above call using the correct path to gall?
I am crating a roulette wheel dynamically. It has one movie clip for the numbers around the edge which it duplicates and positions correctly. My problem is that ever other number has a black background on it (on a real roulette wheel)
Is there a to distinguish between an odd number and an even number
Eg
[AS]
if (i = odd )
{
[Code]....
've created number of "total" movieclips inside "mcThumbnails" using crateEmptyMovieClip function via "for" loop.> their names are as follows: t0,t1,t2,t3,t4,...., t<total-1>> their depth is absolute starting with 500, not using getNextHighestDepth(); now i would like to remove all these created movieclips using a button onPress method
View 7 RepliesI'm confused as to how to reference a movieclip after using the attachMovie method. Here is my code:
[Code]...