ActionScript 3.0 :: Link An Object On The Stage To An External Class File?
Jan 8, 2009
I have a dynamic textfield called neighName on my Flash stage. I also have a movieclip that I call a region on my stage. When I mouseover the region, I want a word to display in a little popup *and* I want some text to display in my textfield. I have an external .as file for handling the region. I can make the code "see" my region, but I can't seem to make it see my textfield, although no errors are being thrown.
View 1 Replies
Similar Posts:
Sep 14, 2010
Ok. So heres what I am trying to do. I want one movie clip to follow another one that I move around with actions on the main timeline.The problem is that the follower clip is linked to a class file and I cannot find a way to find the players position.
[Code]...
View 8 Replies
Sep 6, 2011
I have a media player that I am codging together, one that will play either videos or MP3s depending on the variables it is passed. The video player part works fine. The MP3 player controls are all actual physical MCs on the stage; each one has its own AS class file as part of the package, but there is also a lot of AS that is happening in the main FLA as well. Messy, I know, but it mostly works great.
The MC on the stage in the main FLA is properly linked to the class file via Actionscript linkage, and the control itself works. However, I am trying to make some aspects of the control respond to variables that are set within the AS on the timeline of the main FLA, and I cannot seem to pass values to the control no matter what I do.
[Code]....
View 2 Replies
Sep 6, 2011
I have a media player that I am codging together, one that will play either videos or MP3s depending on the variables it is passed. The video player part works fine. The MP3 player controls are all actual physical MCs on the stage; each one has its own AS class file as part of the package, but there is also a lot of AS that is happening in the main FLA as well. Messy, I know, but it mostly works great.The MC on the stage in the main FLA is properly linked to the class file via Actionscript linkage, and the control itself worksHowever, I am trying to make some aspects of the control respond to variables that are set within the AS on the timeline of the main FLA, and I cannot seem to pass values to the control no matter what I do.The following variable is set in the main AS:Code:var notPlayedYet:Boolean = true;I also have some flashVars being passed in from the html, and these I can reference with no trouble from the main AS - the relevant one is:
View 1 Replies
Nov 21, 2010
I've been searching around all afternoon, and am pulling my hair out. 1) I have a movieclip instance on stage (simple graphical element that represents platforms for a hero to run and jump along). I have placed it on the stage with an external class engine.as and in this class it is called myPlatform and is an object of Platforms.as. The movieClip is called platforms and from a trace(myPlatform.name) the instance name is instance3.
2) I am attempting to access the properties of myPlatform in an Enterframe event loop in my character control and collision class (called hero.as)
Basically here is the bit of code I am trying implement within Hero.as :
[Code]...
This all worked when I was writing actionscipt within the FLA file, on the timeline frame 1. I simply don't know how to access myPlatform from within the external Hero.as class! Do I need to create a variable? Is there a really easy way to do this with some syntax/command that I have not learned yet?
View 3 Replies
Aug 21, 2009
Is there a way to link to a class file from the timeline rather than using the Document Class? (I tried using the document class but it messed up because of the nested movie clips and stuff like that... so I need another way)
View 3 Replies
Nov 24, 2009
have had some trouble coupla weeks finding answers on this - hope i manage to explain myself to get right answer :-)Have a swf file on a website with buttons which each need to link to lightboxes with same class.Now I have following in flash:
DocButt2.addEventListener(MouseEvent.CLICK, DocClick2);
function DocClick2(event:MouseEvent):void{
navigateToURL(new URLRequest ("signup.php?
[code]....
View 5 Replies
Oct 20, 2009
I've re done a couple of pages on my website and as a result of the new design have had to change some of the coding from being on the timeline to being in an external as document linked to my fla. This is significant only because I can link to external pdf.zips no problem on the timeline but I can't seem to translate the code to the external file. Can anyone out there help me out with this (hopefully) simply problem?I'm playing with different variations of this below but I'm constantly getting the 1180: Call to a possibly undefined method navigateToURL.
function onEnglishClick(event:MouseEvent):void {
var request:URLRequest = new URLRequest("http://www.bigredcreativeconcepts.com/UB_Flyer_English.pdf.zip");
[code].....
View 1 Replies
Jan 6, 2011
I have created a class, call it Class1, that has various objects drawn on the stage (drawn in the IDE). It also has a function, called setColour, for changing the colour of those objects. The function works fine if I call it from within Class1.
Now I have another class, call it testClass1, that imports Class1 and calls the setColour function. First of all, none of the stage objects from Class1 are visible. Secondly, when setColour tries to modify the colour of an object, I get the error:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
This is the code for testClass1:
ActionScript Code:
package
{
import flash.display.*;
[Code].....
So, what is the problem? Is it possible to change objects that are drawn on the stage of an imported class?
View 3 Replies
Aug 2, 2010
The following is that long only because I gave examples of what I want to know, not because it is complex .I have three basic questions regarding AS 3.0 classes.
1. How can I make a class object interact with an object on stage?
For example, when I have a square (mc_Square) with class "square" attached to it and I want it to trace "Colliding!" and print the X and Y of the mc_Box on contact with an on-stage *hollow* box (mc_Box) that has no class attached to it.how to do it vice-versa would also be awesome .
2. How can I make a class object interact with the same class object? For example, when I have two squares (mc_Square) that both have the class "square" attached to it and when they collide, it prints the X and Y of both of them.
3. How can I make a class object interact with a different class object?
For example, when I have two squares mc_Square1 with class "square1 (that also has a variable Primary=true written in it)" and a mc_Square2 with class "square2"; When they collide, the one with Primary=true would be removed and it's X,Y position traced.
View 2 Replies
Mar 23, 2004
I followed the tutorial and it works perfect. But I wanna go a step further, how do I link a word in the external text file? It seems that html code <a href="www.me.com">CLICK</a> doesn't show as a link, but exactly as text.
View 1 Replies
Sep 20, 2009
So, I can't remember and it's not working. I basically want to add this to my text file:
<a href="[URL]" target="_blank">Go here</a>
Which obviously doesn't work. what's the easiest way add HTML tags to a TXT file without changing the way the files being loaded too much?
var filename:String="text/home.txt";
var loaderText:URLLoader = new URLLoader();
var myRequest:URLRequest=new URLRequest(filename);
function loadFile(filename:String):void {
myRequest.url=filename;
loaderText.load(myRequest);}
loadFile("text/press.txt");
View 1 Replies
Oct 20, 2010
I have purchased an image gallery program that works fine but I am struggling to make a very minor modification. I have asked the author for assistance but previous requests have met with no response so I am also asking my question here. This program has most of its logic in an external AS2 file. I have made some small changes to this file and want to save it under a new name. However, that would also require me to change the reference to the external AS2 file from within the fla file. That's where my problem lies. I can't find any code in the fla that contains such a reference.
If I try to publish an swf without this file in the required location it causes a compiler error thus proving that there must be a reference somewhere to that file. However, doing a search for this AS2 file in the 'current document' when viewing the fla file in Flash CS4 produces no results. Where else could this reference be hidden?
View 11 Replies
Jun 25, 2009
I purchased a TM AS2 Flash 8 / XML Template. I'm trying to figure out how to create a text link inside my XML content that can link back into the flash movie to a specific MOVIE/FRAME.
I've found where a XML text link can trigger a function (<a href="asfunction:_root.more_click_func,0">), but I can't seem to figure out how to simply go to a specific frame in the flash. I would think that this would be easy. ??? I don't need to do anything dynamic, except load the link exactly as presented in the XML file.
View 0 Replies
Jan 24, 2005
Is there a way to load a link text from an external txt file into a dynamic text field of a flash file?
View 3 Replies
Jan 24, 2005
Is there a way to load a link text from an external txt file into a dynamic text field of a flash file?
View 3 Replies
Nov 3, 2011
Does any know how to load a XML into a Flash file using FlashVar?
I have these lines that load my XML data from a folder called XML
var url:String = "xml/TEST.xml";
var req:URLRequest = new URLRequest(url);
var uLdr:URLLoader = new URLLoader();
[Code]....
I would like to use FlashVar to enter the "xml/TEST.xml"; portion so I can keep reusing the SWF file and only have to enter a FlashVar in the HTML to point to the data. I have some users that are not Flash programmers and it would be easy for them to past the HTML and only have to change the FlashVar line to point to their XML file, as opposed to having to get me to hardcode it everytime.
View 1 Replies
Mar 23, 2004
I followed the tutorial [URL] and it works perfect. But I wanna go a step further, how do I link a word in the external text file? It seems that html code <a href="www.me.com">CLICK</a> doesn't show as a link, but exactly as text.
View 1 Replies
Jan 15, 2006
How do I link from one specific frame in one swf file to another specific frame in another swf file?It should be something like...
on(release){_root.gotoAndStop(8)}
...but where I want to get linked to another file in frame 8.Do I just simply rewrite _root to something else?
View 6 Replies
May 26, 2009
I have some buttons in my main movie.I want each button to link to a different frame of an external movie. Is this possible?
View 2 Replies
Aug 18, 2009
I found myself loading a new XML file every day and so decided to create a small class that will load the xml file and return it.The class is loading the file but when i try to return it to a new xml object in the document class it doesnt load it.I think that it's something to with the return being in a nested function but i tried a few ways and non seems to work.
[DOCUMENT CLASS]
loadXML:LoadXML = new LoadXML();
myXML:XML = new XML(loadXML.loadXMLFile("gallery.xml"));[code].....
View 1 Replies
Jul 22, 2009
I'm trying to create a new instance of a MovieClip when the original one has been used. Would sound easy enough. Just use: var
instanceName:ClassName = new ClassName();
the class name/mc in the library im trying to duplicate is MCg1 so
var instanceName:MCg1 = new MCg1(); right?
However, the particular object in the library i'm trying to duplicate has a base class that is an external class file (just to control it's drag drop functionality)... i.e baseclass is not set to the standard flash.display.MovieClip, or whatever the case maybe. So i end out with a: TypeError: Error #1009: Cannot access a property or method of a null object reference.
View 6 Replies
Apr 21, 2009
I managed to load in an external swf file okay however, I need to be able to remove it when the user clicks a link to go back to the homepage. Below is my code:
Code: Select allstop();
var imageRequest:URLRequest = new URLRequest("gallery.swf");
var imageLoader:Loader = new Loader();
imageLoader.load(imageRequest);
addChild(imageLoader);
home_link_btn.addEventListener(MouseEvent.CLICK, homeLink);
[Code] .....
I assumed it was as simple as removing the child but it still remains. I get no compile errors or anything.
View 2 Replies
Nov 20, 2009
All I'm trying to do is load an external .swf file into a precise location on the stage of my existing Flash file. I've spent an hour and a half on this site search and found nothing. What do I add to my loadMovie command to place the file at specific x,y coordinates?
View 3 Replies
Aug 16, 2010
I got my HTML embedded in my flash file, finally!But now I want some parts of the text that is in the HTML file to link to a specific label in flash itself.What variable can I use for this? or even a Href link?
View 2 Replies
Nov 21, 2009
I have a custom class which uses some buttons on the stage. Or at least is trying to.say have this code in the customClass.as file
package{
import flash.events.*;
import flash.display.MovieClip
[code].....
View 5 Replies
Oct 16, 2010
How you can assign a class to an object on stage.[code]...
This would make a new object, but the current object already exists, it just needs to be notified that it's of the type "ClassName" so it can inherit it's properties.I've also tried assigning the "ClassName" in the linkage as either the base path or the class name. But in either situations I get an error saying that the class needs to be unique when I use the same class on multiple objects.
View 3 Replies
Jan 6, 2010
I have a document class called Main, and a class called DispatchEventExample. In DispatchEventExample, I'm trying to add an event listener to the stage but get an 1120 error, access of undefined property stage.
If I understand things correctly, even though I create an instance of DispatchEventExample in Main, it's not added to the display list & therefore cannot access stage.
[Code]...
View 1 Replies
Feb 13, 2009
Linking class with stage object..
View 14 Replies
Nov 16, 2010
I have a class that have a method to do some work and return a MovieClip. How can I access the stage from the class ? I don't add the class object to stage.
My code is like this :
Code:
import com.ClassName
.
.
.
var c:ClassName= new ClassName();
var mc:MovieClip;
mc = ClassName.create("some parameter");
I want to get access to the stage from ClassName class file.
View 3 Replies