Access Content Inside A Tilelist?
If I populate a tilelist with movies from the library', is there a way I can access these? I know with a scrollpane, I can do something like MovieClip(scroller.content).instanceIwantToAccess. addEventListener(MouseEvent.CLICK, handler);Is there something similar I can do with the tilelist?
Adobe > ActionScript 3
Posted on: 07/23/2008 06:52:32 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Access Content Inside A Tilelist?
If I populate a tilelist with movies from the library', is there a way I can access these? I know with a scrollpane, I can do something like
MovieClip(scroller.content).instanceIwantToAccess. addEventListener(MouseEvent.CLICK, handler);
Is there something similar I can do with the tilelist?
Access Content Inside Window Component?
Is there any way that I can access for instance box_mc which is inside window component that is created by:
MyWindow = PopUpManager.createPopUp(_root, Window, false, {closeButton:true, title:" - Testing!", contentPath:"box_mc"});
with AS 2 player 7.
I tryed
MyWindow.box_mc._x+=50;
but it doesn't work.
Help Scaling Content In TileList Component
Like the title says, I'm loading .pngs into a tilelist and the images have quite a bit of dead transparency zone around each one... So flash zooms them out too tiny so they fit inside the tilelist boxes. Is there any way I can disable the scaling or reduce how much it scales?
AS3 Loader.content Access To Partially Loaded Content
I have a main swf that loads an external swf. The external swf is a fairly large video embeded on the timeline.
Ive got my Loader all setup correctly, handling PROGRESS, COMPLETE and INIT events all fine.
What id like to do (which i could do in AS2 very easily) is start the playing and accessing variables in the loaded swf before it finishes loading. If i do these things when the video swf is loaded completely, everything works fine.
Any attempt to access Loader.content or the container clip ive placed Loader.content in, BEFORE its finished loading (when it reachs, lets say, 20%), i get error:
#2099 The loading object is not sufficiently loaded to provide this information.
Anyone have any ideas on how it could be possible to start messing with loaded SWF content before all of its frames are loaded? Thanks in advance for lookin over my post!!
Read And Access Of A Zip's Content
Hi everyone,
As in the title, what i'm trying to do, is to read the content in a Zip file.
So, Is it possible in AS2/AS3 (maybe in AIR) ?
And if it's possible, how to do such a thing?
Thanks.
Access Content Of Loader
Last edited by SkyNarc : 2006-11-22 at 01:33.
Hi,
I'm loading an image into a loader from an Array which is loaded from an XML file.
Now I'm trying to change the X position of that image but cannot access it since this is the first time I am doing this.
My loader is called loader_mc and my array for the images is called propertyImage so I've tried this without much luck:
PHP Code:
_root.loader_mc.propertyImage[currentProperty]._x
Thanks..
Problem To Access The Content Of A Variable..
I have a dynamic textfield whose var name is "actu", this textfield is in a MC named "scrolltext".
The content of the textfield is loaded by a loadvariable("txtfile","")
So far so good, the textfield displays the right text, but then i can't managed to accessed the content of the textefield.
I've tried to trace(_root.scrolltext.actu) and the result is "undefined".
Please help me
thanks a lot
FCS3 - XML Content & Direct Access
Hi People,
I have a question regarding direct access to XML Data nodes. Please bear in mind I am building this application for an Online Advertisement so loading times are essential.
The first question to ask is: How much XML Data is acceptable to be loaded on the first frame? There will be about 100 different products, each with 6 attributes (Name, ImgPath, etc). Is this going to be too much? If yes, please read on...
I am building an application which will contain around 100 different products, I generally build XML applications by bringing all the data in at the beginning, putting it into Arrays and displaying it when necessary. This has served me well in the past and I would like to stick somewhat close to this for sanity's sake. I am hoping to reduce the amount of data brought in on the first frame to reduce loading time and make it easier for myself to debug, is it possible for me to access specific child nodes by a name that will be retreived from the users selection. I am hoping this will reduce loading times and make it easier for me arrange everything, as I will only have to data I need and can update it when necessary.
Any assistance greatly appreciated,
thanks in advance.
Flash Access Local Content
We have received a request to serve SWF files from a server, but to place the FLV files that they access on the persons local machine. The reason for the request has to do with bandwidth. Is there any way to accomplish that? Anyone have any ideas?
Loader Class Access .swf Content
Hi!
I am having trouble accessing a MovieClip from a .swf file that I load in my main movie.
I use a code similar to the one bellow, and myMovieClip is a MovieClip placed directly on the stage of my .swf file.
I would apreciate a little help on this.
Thank you!
Attach Code
var loader:Loader = new Loader();
loader.loaderInfo.addEventListener(Event.COMPLETE, on LoadComplete);
funciton onLoadComplete(event:Event):void {
loader.myMovieClip.visible = false; // for example
};
loader.load(new URLRequest("mySwf.swf"));
Flash Access To Read The Folder Content
I am trying to make a gallery which I know previously that we could make flash reads the folder "eg. gallery/" by using xml and database and the only thing that we could do it dynamically is only thru php. But I was just wondering whether there's a new method in flash for me to just point a folder and flash reads the whole content in that folders and loop through it?
I asked this because of the purpose of me trying to let people to upload to that folder and if there's any new images, then flash would dynamically reads it.
And also just one more question. Can flash make new folders?
Problem No2: Combobox + Access = Dynamic Content
I try to populate a combobox from an Access database. The thing is that i dont have a clue of how this is done......Does anyone know any good tutorials? I would really appreciate it.
* I dont know if it is my idea or not but NOT many people use flash and database integration.
Display Content In Flash From An Access Database
Hey...
I have a flash movie which is just a simple animation (which this part is totally irrelevant to what am trying to achieve but anyway) at the end of the animation, I would like to display some names that would scroll from left to right (Like the Star Wars film credits but instead of text going bottom to top it would go from Left to Right). And DON’T HAVE TO FADE OUT.
Now! The problem is that I want it to display the names on a screen from the Database which would be created in Access (have to be access if possible).
So any names entered into the database will get pull out and displayed on the screen and that animation (of names going from left to right) would just loop.
Also the extraction from the DB would be done at runtime, so as soon as you add a name in the database it would display in the next loop of the movie.
Is something like is possible? If so could somebody help me with this? It would be much appreciated.
Many Thanks
Display Content In Flash From An Access Database
Hey...
I have a flash movie which is just a simple animation (which this part is totally irrelevant to what am trying to achieve but anyway) at the end of the animation, I would like to display some names that would scroll from left to right (Like the Star Wars film credits but instead of text going bottom to top it would go from Left to Right). And DON’T HAVE TO FADE OUT.
Now! The problem is that I want it to display the names on a screen from the Database which would be created in Access (have to be access if possible).
So any names entered into the database will get pull out and displayed on the screen and that animation (of names going from left to right) would just loop.
Also the extraction from the DB would be done at runtime, so as soon as you add a name in the database it would display in the next loop of the movie.
Is something like is possible? If so could somebody help me with this? It would be much appreciated.
Many Thanks
How To Access Mc Inside Btn
I try to make simply effect on btn.
On rollover have one mc inside.
I cant find way how to access mc over_mc inside btn on the stage.
Look my example.
Thanks for ideas.
How To Access Mc Inside Btn
I try to make simply effect on btn.
On rollover have one mc inside.
I cant find way how to access mc over_mc inside btn on the stage.
Look my example.
Thanks for ideas.
Access Mc Inside Button?
MX 2004 Pro:
I need to change the color of an MC instance (Test1) that is on the UP frame of a button (btnTest).
ActionScript Code:
trace(btnTest.Test1._width)
returns "undefiend". But when I turn the button into a MovieClip:
ActionScript Code:
trace(mcTest.Test1._width)
returns a correct value, meaning, I can access Test1.
Is there a way to access MC instances inside a button?
Access A Function That Is Inside Of A Swf From Another Swf
Hi,
I'd access a function that is inside of a swf that is loaded by a Loader. For example:
-I have a function at mundo.swf called : ola();
-I am loading this swf at another swf :
Code:
var urlReq:URLRequest = new URLRequest();
var loader:URLLoader = new URLLoader();
urlReq.url="mundo.swf";
ldr2.load(urlReq);
addChild(ldr2);
- I wanna access this function (I 'm trying:
Code:
var Variavel =MovieClip(ldr2.content);
Variavel.ola();
Thanks!!!!!!!
Access A Var Inside A Child MC
Hi,
I'm new to AS3 and have a movie clip on the stage that contains a var,
the MC is called "myMC"
ie
Code:
var path = "my path";//this is in the first frame of myMC
I want to access this value from the parent element, in this case it is the stage.
So on the first frame on my stage i have,
Code:
trace(myMC.path);// this returns underfined
This would work in AS2.
Can i access this or do i need to create a class to access vars of a child?
Thanks in advance.
PS, i have had a good hunt arround for this simple problem but can only find solutions for accessing the stage properties from within a child grrr.
Cool
How To Access A Variable Inside A Movieclip?
Hey I'm new to Flash and use Flash MX 2004.
I'm creating a game where I duplicate an alien movieclip 20 times. Inside each alien movieclip is its own variable called speed. During the game their speed varies.
What I'm trying to do is have a function that will loop through the 20 aliens and multiply their speed by 3. I tried using a for loop and doing eval(currentalien + i + "_mc").speed *= 3; but that didn't work. And when I did a trace I got undefined. So I guess it can't access it.. and that's my problem. How can I make this work?
Access Button Inside Movieclip
Hey Everyone,
I am not that familiar with Flash yet, so I have trouble accessing a button inside a Movieclip that I have loaded by using the loadMovie command.
code:
createEmptyMovieClip("menu",1);
menu.loadMovie("menu1.swf",1);
menu.button.onPress = function(){
trace("works");
}
My movie loads fine and my button has the instance name button. So that should not be the problem.
Thanks for any help,
Andy
Access Class Inside Loaded SWF
Hello
I have a problem i can't really figure out. Here's the case.
I have a .fla with a document class. Inside the documentClass i load another SWF. The SWF loaded has objects with Classes linked. Like: "com.menu.item".
When i have loaded the SWF i can access the objects through the following from my documentClass:
import com.menu.item;
var _item: item = new item()
addChild(_item)
This works fine and i can see the object being added. The problem is that the object has a timeline and that timeline doesn't work. A simple stop is not triggered. Anyone have an idea how to fix that?
Any help appreciated
Regards
Rick
Access Mc Inside Dynamically Attached Mc? Please Help
I have an array of dynamically attached mc's, and I want to set text in a textfield that is inside movieclip that is inside each one of the attached mc's. I keep getting this error:
TypeError: Error #1010: A term is undefined and has no properties.
Here is the part of my code I'm having problems with. The mc is "square," the mc inside of it is "thumbText_mc," and the textfield inside of that is "hoverText":
Code:
function createThumbs(){
var myXML:XML=new XML(xmlLoader.data);
for (var z:int = 0; z<(myXML.image.length()); z++){
var but:square = new square();
butContainer.addChild(but);
but.name = "button" + z;
butArray[z] = butContainer.getChildByName("button" + z);
butArray[z].x = (z*300);
butArray[z].y = 0;
butArray[z].buttonMode = true;
butArray[z].addEventListener(MouseEvent.CLICK, loadThumb);
var thumbs = butArray[z];
thumbs.num = z;
thumbs.thumbText_mc.hoverText.text = (myXML.image[z].@capTwo);
Thanks in advance
Access Button Inside Of Loaded Swf
Hello to all! So, i'm loading a swf (image gallery) that fills the entire index movie's stage. I created a "close" button in the swf. So, you're inside the index movie and click gallery. It loads on top of the entire index movie so it appears as an image gallery with a solid background, none of the index elements are seen, but exist behind the gallery swf. What i want to do is access the close button in the gallery swf so when it's clicked, it closes and the index stage is being viewed again. Ideas? Helpful Hints? Are the Lakers going win?
Access Text Field Inside Movie
I want to address a text field ("/ann_input") which is located inside a mc ("/ann_mov"). How do I do that? This is what I've tried out already:
Code:
onClipEvent (enterFrame) {
if (ann_mov._currentFrame == 2 AND ann_mov.ann_input != "") {
this.gotoAndStop(2);
}
}
also:
Code:
onClipEvent (enterFrame) {
if ("/ann_mov"._currentFrame == 2 AND "/ann_mov"."/ann_input" != "") {
this.gotoAndStop(2);
}
}
- naturally, neither works. HELP!
Access Instance Inside Movie Clip
Hi all iam khader ,
Really i have small problem ,which is how can i access an instance inside movie clip,
i tried to wirte the following
_root.movieclip1.instancename ;
when i wrote this code it just access the movieclip1 and it dosn't arrive to the instancename inside it so how i control this instance using action scrip in flashMx
thanx alot
How To Access 'global' Variable From Inside A Class?
On the main timeline I have :
var str:String = "test";
In an .as file I have :
package {
public class externalImg extends Sprite {
public function externalImg(url:String) {
trace ("scope test " + str);
}
}
}
This simply prints "scope test", but not the value of str. Why can't I get to the 'global' var str?
Can't Access Array Inside 'onRelease' Function
Another issue from this site i'm trying to put together... *sigh*. So I've got a bunch of nested for loops, and i'm trying to add dynamic behavior to a movieclip that was just created. I want it to attach x number of movies when it is clicked, and x is stored in an array. When i try to access the array from within the onRelease function, it comes up as undefined. looking for a way to access it, or a work around to access it. Thanks for your help.
The applicable section is in Blue.
Code:
if (pageList.firstChild.childNodes[i].childNodes.length > 0) {
for(var j = 0; j<pageList.firstChild.childNodes[i].childNodes.length; j++) {
_root["subSect"+j] = [];
_root["subSect"+j].push(pageList.firstChild.childNodes[i].childNodes[j].attributes.title);// [0]subSection title
_root["subSect"+j].push(pageList.firstChild.childNodes[i].childNodes[j].childNodes.length);// [1] subSection # of pieces
_root["sect"+i].push(_root["subSect"+j][0]);
menuCount++;
//create menuSubItems
_root.createEmptyMovieClip("m_mc"+menuCount,_root.getNextHighestDepth());
_root["m_mc"+menuCount].createTextField("m_items_txt",_root.getNextHighestDepth(),menuX,menuY,100,20);
_root["m_mc"+menuCount].m_items_txt.embedFonts=false;
_root["m_mc"+menuCount].m_items_txt._alpha=100;
_root["m_mc"+menuCount].m_items_txt.text=sectList[i][j+1];
_root["m_mc"+menuCount].m_items_txt.setTextFormat(midLvl_fmt);
menuY+=12;
menuX+=15;
if (pageList.firstChild.childNodes[i].childNodes[j].childNodes.length>0) {
for(var k = 0; k<pageList.firstChild.childNodes[i].childNodes[j].childNodes.length; k++) {
_root["artwork"+k] = [];
_root["artwork"+k].push(_root["subSect"+j][0]); //[0] section title
_root["artwork"+k].push(pageList.firstChild.childNodes[i].childNodes[j].childNodes[k].attributes.title); //[2] piece title
_root["artwork"+k].push(pageList.firstChild.childNodes[i].childNodes[j].childNodes[k].attributes.desc); //[3] piece descrip
_root["artwork"+k].push(pageList.firstChild.childNodes[i].childNodes[j].childNodes[k].attributes.fileLoc); //[4] piece piece File loc
_root["subSect"+j].push(_root["artwork"+k]); //add artwork beneath subsections
}
}
trace(_root["subSect"+j][1]);
//make each subMenu clickable so that it pulls up the appropriate # of imageLink buttons
_root["m_mc"+menuCount].onRelease = function() {
for(var m = 0; m<_root["subSect"+j][1]; m++) {
attachMovie("imageLink", "imageLink"+m, _root.getNextHighestDepth());
_root["imageLink"+m]._x=150+(m*10);
_root["imageLink"+m]._y=300;
}
}
}
}
Access To Variables Inside A Loadvars Function
Hi. In example#1 i have the variable.................var username = this.load........i'd like to know how to access the varible from other parts of the action script.
In example#2 i tried to trace the username from outside the onLoad function but the trace output is.... undefined.
will somebody please tell me how to access the var username:String = this.valid;..........variable?
example #1
var myLoadVars:LoadVars = new LoadVars();
myLoadVars.onLoad = function(success) {
var username:String = this.valid;
_root.msg.text = username;
trace(username);
}
myLoadVars.load('test4.php');
////////////////////////////////////////////////////////////
example #2
var myLoadVars:LoadVars = new LoadVars();
myLoadVars.onLoad = function(success) {
var username:String = this.valid;
_root.msg.text = username;
trace(username);
}
myLoadVars.load('test4.php');
trace (username);
Any Way To Access Embedded Domain Url From Inside Flash?
I've got a flash movie that a lot of people are embedding in different spots, and I'd like some way to track which domains it shows up on. A lot of the embedding is going on in myspace, so I don't want to do anything crazy like Javascript/Actionscript Gateways or proxies, cause I dont' think they'll allow it.
Seems like the embedded domain should be a local variable inside Flash, but I sure can't find it. The localConnection class's domain() method just returns my own server, cause that's where the swf is.
Any ideas? I'm beginning to think it's just not possible.
Access Variables Declared Inside Functions
Hi guys, i have a problem in AS3
I have a problem with a function that needs to access a variable declared inside another function.
What I understand is how a variable can change due to var X:Number=0
because var PictureLink:String = Array[X] when X increments. What i don't understand is how when an event listener listens for a mouse click on a movieclip which load another movieclip with link PictureLink, it knows which Array[X] it is when the X has already incremented through all the pics.
By the tutorial I watched (Cartoon Smart AS3 XML Gallery), he said "we need to create variable PictureLink to store Array[X] at a particular time to when user click on thumbnail, it goes to the correct link.
This all worked fine but the code was getting too long and i wanted to seperate this massive functions into their own .as files, this is when it stuffed up.
WHY, because the loaded was refering to Array[X] when that var was declared in the previous function and now I can't reference it .
Here's my code. Some things aren't in the, like gallery pane and some other layout script because they're in other .as files, they won't matter though to solve the problem.
Code:
var mainPicArea:MovieClip = new MovieClip();
mainPicArea.buttonMode = true;
mainPicArea.useHandCursor = true;
addChild(mainPicArea);
var all_thumbs:MovieClip = new MovieClip();
all_thumbs.buttonMode = true;
all_thumbs.useHandCursor = true;
addChild(all_thumbs);
galleryPane.source = all_thumbs;
var fadeIn:Tween;
var fadeOut:Tween;
var urlVar:String = "xml/gallery.xml";
var highResPathList:Array = [];
var lowResPathList:Array = [];
var thumbPathList:Array = [];
var pictureTitleList:Array = [];
var pictureDescList:Array = [];
var totalPics:Number;
var mainPicPlacementX:Number;
var mainPicPlacementY:Number = 100;
//LOAD THUMBNAILS
var thumbLoader:Loader;
// variable for load thumbs function loop
var c:Number = 0;
// spacing between each thumb on x-axis. Number includes thumb width plus spacing
var xSpacing:Number = 105;
// spacing between each thumb on y-axis
var ySpacing:Number = 105;
//how many thumbs are occupying a row
var xs:Number = 0;
//how many thumbs are occupying a column
var ys:Number = 0;
var thumbRowCount:Number;
var thumbColumnCount:Number;
var thumb_orientation:String;
//////////////////////
function loadTheThumbs()
{
thumbLoader = new Loader();
var thumbRequest:URLRequest = new URLRequest(thumbPathList[c]);
thumbLoader.load(thumbRequest);
thumbLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, whenThumbsLoad);
function whenThumbsLoad(event:Event):void
{
var thisMainsLink:String = highResPathList[c];
var thisThumbsLink:String = lowResPathList[c];
var thisPicsTitle:String = pictureTitleList[c];
var thisPicsDesc:String = pictureDescList[c];
//spread thumnails along x-axis by xs
thumbLoader.x=(xs*xSpacing); //add pixels to end of equation for a buffer. For eg ....+8 (optional)
//spread thumnails along y-axis by ys
thumbLoader.y=(ys*ySpacing);
if (thumbColumnCount==0){
xs = xs + 1;
//trace("row space")
}
if (thumbRowCount==0){
//trace("column space")
ys = ys + 1;
}
if (thumbColumnCount==0 && xs==thumbRowCount) //if row has reached the max thumbs per row, then start a new row
{
//trace("row add")
//by reseting the x placement
xs = 0;
//on a different row
ys = ys + 1;
}
if (thumbRowCount==0 && ys==thumbColumnCount) //if row has reached the max thumbs per column, then start a new column
{
//trace("column add")
//by reseting the x placement
ys = 0;
//on a different row
xs = xs + 1;
}
thumbLoader.addEventListener(MouseEvent.CLICK, loadMainPic); //listener when thumbnail has been clicked
all_thumbs.addChild(thumbLoader);
c = c + 1;
if (c<totalPics)
{
loadTheThumbs(); // calls the first function in this file again (for the amount of thumbs)
} else {
xs=0;
ys=0;
c=0;
}
} // end if(c<totalPics)
} // end whenThumbsLoad
} // end loadTheThumbs
///////////////////
function loadMainPic(event:MouseEvent):void
{
thumbLoader.removeEventListener(MouseEvent.CLICK, loadMainPic);
if (mainPicArea.numChildren == 1){
mainPicArea.removeChildAt(0);
}
picDesc.text = "";
picTitle.text = "";
loadingText.x = mainPicPlacementX;
loadingText.y = mainPicPlacementY;
var mainLoader:Loader = new Loader();
var mainRequest:URLRequest = new URLRequest(thisThumbsLink); ////THIS IS THE PROBLEM, I CAN'T GET "thisThumbsLink from 'whenThumbsLoad function"
mainLoader.load(mainRequest);
mainLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, progressHandler); //listener while main pic loading
mainLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, mainLoaded); //listener when main pics has loaded
function progressHandler(event:ProgressEvent):void //pre-loader function
{
var kbLoaded:String = Number(event.bytesLoaded/1024).toFixed(1);
var kbTotal:String = Number(event.bytesTotal/1024).toFixed(1);
loadingText.text = "Loaded "+kbLoaded+" of "+kbTotal + " KB";
} // end progressHandler
function mainLoaded(event :Event):void
{
thumbLoader.removeEventListener(MouseEvent.CLICK, loadMainPic);
loadingText.text="";
if (thumb_orientation == "horizontal" || thumb_orientation == "vertical"){
mainPicPlacementX = (stage.stageWidth / 2) - (mainLoader.width / 2); //if you want mainPic to move on x-axis in relation to stage
mainPicArea.x=mainPicPlacementX;
}
mainPicArea.y=mainPicPlacementY;
mainPicArea.addChild(mainLoader);
fadeIn = new Tween(mainPicArea,"alpha", None.easeNone, 0, 1,1, true)
picTitle.text = thisPicsTitle;
picDesc.text = thisPicsDesc;
picTitle.x = mainPicArea.x;
picDesc.x = mainPicArea.x;
picTitle.y = mainPicArea.y + mainPicArea.height + 5;
picDesc.y = mainPicArea.y + mainPicArea.height + 20;
picTitle.width = mainPicArea.width;
picDesc.width = mainPicArea.width;
} //end mainLoaded
} // end loadMainPic
i'm new to as3 so i would love any knowledge on the issue or any direction. Also another thing i would love to know, how to send values from function along with eventListener, that would solve the problem, being able to send variables through the event listener into the function that gets triggered.
Cheers
KayaScript
Access A Component Inside External Swf File
Hi, I loaded a external swf file that it is a dialog.
var swfLoader : Loader = new Loader();
var swfURL : URLRequest = new URLRequest("dialog.swf");
swfLoader.load(swfURL);
swfLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,imgLoaded);
function imgLoaded(event:Event):void
{
var movie : * = swfLoader.content;
var clip : MovieClip = movie;
parent.addChild(clip);
}
Now, inside the movieClip there is a TextField component named message that i want to change its 'text' property.
The question is: How can i access to this property to change it?
Regards
[mx04] Can't Access Buttons Inside Scrolling Mc
I have a group of buttons that are grouped together and animated to move continuously across a MC. This SWF gets dynamically loaded into my main movie. Now, I want to be able to click on the buttons in the loaded SWF, and have the button click cause another SWF to be loaded into a different empty MC.
Can anyone help, please?
Thank you in advance.
Access Text Property Inside Movie
Hi everyone,
Sorry for this very basic question. I have a movie clip which contains a text label. What I want to know is, how do I change the text property from the main movie?
Thanks for any help
Access To Variables Inside Class File
Hello,
I'm trying to set up a class file that will read a bunch of links from an XML document so I can populate some buttons on the stage. The problem I am having is gaining access to the links within the class file. I have no clue how to get at "theWebsite" from the main document. Any help would be greatly appreciated!
This is what I have so far
Class file:
Code:
package {
import flash.display.MovieClip;
import flash.display.*;
import flash.text.*;
import flash.net.*;
import flash.events.*;
public class xmlLinkLoader{
//VARIABLES & Event Listeners HERE
trace("xml Link Loader CLASS Imported");
public var theText:TextField;
public var theWebsite:String;
public var myWebsiteLink:String;
public var myURLLoader:URLLoader= new URLLoader();
public var xmlData:XML = new XML();
public var myURLRequest:URLRequest= new URLRequest("links.xml");
public function xmlLinkLoader() {
myURLLoader.load(myURLRequest);
myURLLoader.addEventListener(Event.COMPLETE,dataOK);
}
public function dataOK(myevent:Event):void {
trace("xml loaded");
xmlData = new XML(myevent.target.data);
for (var i=0; i<xmlData.splashlink.length(); i++) {
var websiteLink = xmlData.splashlink.@theBandsWebsite;
}
populateMe();
trace(websiteLink);
}
public function populateMe() {
trace ("populated");
var theWebsite = xmlData.splashlink.@theBandsWebsite;
}
//
}
}
Document:
Code:
import xmlLinkLoader;
var myxmlLinkLoader= new xmlLinkLoader;
[mx04] Can't Access Buttons Inside Scrolling Mc
I have a group of buttons that are grouped together and animated to move continuously across a MC. This SWF gets dynamically loaded into my main movie. Now, I want to be able to click on the buttons in the loaded SWF, and have the button click cause another SWF to be loaded into a different empty MC.
Can anyone help, please?
Thank you in advance.
I Have A Menu Inside A MC, I Need To Access Other Scenes From The MC (Flash MX WinXP)
I have having great problems getting this to work.
I have a movie clip (called "menu") that has my menu inside it. Each button has the following AS:
Code:
on (release) {
_root.gotoAndPlay("contact", 1);
}
Now, in theory that will goto the scene "contact" - but it doesn't, it just sits there doing nothing.
Aparently there is something about a Tell Target, and I have tried using the Macromedia Support Centre, but it just confused me further.
I have Windows XP with Flash MX.
Any help will be much apppricated.
TE
Getting Flash Buttons Inside Swf File To Access Url In Dreamweaver
All the things I could do in Flash mx and can no longer do in mx04.
I have created simple rollover buttons within a Flash swf file. This file is loaded into a Dreamweaver page. I want to be able to go to another page in the website by pressing the buttons. I have tried to code it but it does not work:
attempt 1:
on (release) {
getURL(principal.htm_self);
}
attempt 2: 'aboutus' is the name of the folder in which the htm tag is located
on (release) {
getURL(aboutus/principal.htm_self);
}
Access Movie Clip Inside ScrollPane Component
How do you access a movie clip that's inside a scrollPane component? I'm not having any luck; I guess it's because the movie clip is not actually nested inside the scrollPane component, but is just linked to it.
Here's my code, which is in frame actions of the main timeline:
scrollPane1.box1._visible=false; //doesnt work
scrollPane1.box1._visible=false; //works
1087 Error From Trying To Access A Button Inside A Symbol
Hey All,
I've been getting a 1087 error with regards to my attempts to access a button inside a symbol which is being referenced by a ScrollPane Component.
The basic idea is for the user to click a button in the symbol scrollable symbol, that in turn affects a movie clip outside the symbol and ScrollPane. The code I am using is as follows.
Code:
// infoPaneMC is the movie clip outside the ScrollPane that I am trying
// to activate. In a perfect world, pressing the button below would
// cause it to slide into frame (or halfway through its timeline)
infoPaneMC.stop();
// scrolltest is the movie clip symbol referenced by the ScrollPane
// 1800_R_Button is the button inside scrolltest
scrollTest.1800_R_Button.addEventListener (MouseEvent.MOUSE_UP,startClip);
function startClip(e:MouseEvent) {
infoPaneMC.play();
}
// This code is what I am using to close infoPaneMC by playing it
// out from its halfway mark
infoPaneMC.addEventListener (MouseEvent.MOUSE_UP,startClip2);
function startClip2(e:MouseEvent) {
infoPaneMC.gotoAndPlay("infoPanePause");
}
However I keep getting the following error:
1087: Syntax error: extra characters found after end of program.
The line it refers me back to is:
Code:
scrollTest.1800_R_Button.addEventListener (MouseEvent.MOUSE_UP,startClip);
Any ideas?
Thanks!
Boz
Global Variable Access Inside Class Functions
Hi people,
I don't understand very well how does flash accesses global variables:
I want to create a news loading system which gets in real time a record from a database. I want to avoid loading all the records at once to avoid memory wasting. So, my idea is to first get all the records id to a array and then load them one by one.
I'm using the following code to get the id's:
mainurl = "http://192.168.1.2/beta/";
_global.idarray = new Array();
newsData = new LoadVars();
newsData.load(mainurl+"news.php");
newsData.onLoad = function(status) {
if (status) {
_global.idarray[0] = this.totalnews;
for (i=1;i<=this.totalnews;i++) {
_global.idarray[i] = this["news"+i+"Id"];
}
}
else {
trace ("Error loading data");
}
}
trace(_global.idarray[0]);
trace(_global.idarray[1]);
But in this last traces i get undefined. Why cant it access the global var inside the onload function? I have several problems with this kind of stuff.
Can anyone give me some lights here?
Thx
Access Array Values Modified Inside Function
I'm trying to access the 'names' array values from outside the function. The textbox 'txt1' displays the correct values, however the final line won't trace out any value for names[1] (not a problem with array length). I'm sure this is a scope issue, but thought declaring the names array outside of the function would allow for the values created in the function to be accessible outside of the function. Thanks in advance for any help!
Code:
test_xml = new XML();
test_xml.ignoreWhite = true;
test_xml.load("test.xml");
var email = [];
var names = [];
test_xml.onLoad = function(success){
if(success) {
for (var n = 0; n<test_xml.firstChild.childNodes.length; n++) {
var currentNode = test_xml.firstChild.childNodes[n];
names[n] = currentNode.attributes.name;
email[n] = currentNode.childNodes[2].firstChild.nodeValue;
}
for (var i = 0; i<names.length; i++) {
txt1.text += "Name: " + names[i] + "
Email: " + email[i] + "
";
}
}
else {
trace("Problem getting XML");
}
}
trace("Name is: " + names[1]);
Unable To Access Function From Inside A Loaded Movie...
Guys,
I am new to Actionscript. Up till now I have only used flash for animation. So hopefull I make sence...
I have a movie called Loader.
In loader I have a tooltip function (fillTip) which shows tool tip for items in that movie (works fine in loaders.swf).
Now I am loading another movie (movie.swf) inside loader. I want to access a function located in the loader.swf. Being this is a second movie that is loading, I can use trace to check my problem...
I have tried _root.fillTip and _global.fillTip...
Please advise,
Shrini
Target/access Button Inside (attach) Movieclip
Hi everyone,
im new to flash and actionscript v2.
would be great if i could get a shove in the right direction.
im trying to get a button working that is inside a movie clip.
the movieclip is given a linkage identifier (container_id and name as container_mc) as it is inside the library and not on the stage.
The movie clip has three buttons inside it.
I have the following code on each of the button
Code:
_root.containerBase_mc.scrollUp_btn.onRelease = function() {
trace("scrol upn");
};
this.containerBase_mc.scrollDown_btn.onRelease = function() {
trace("scrol down");
};
this._parent.containerBase_mc.close_btn.onRelease = function():Void{
trace("close me");
}
as you can see my desperate attempts to get this working
none of the trace actions work...
any help?
thank you.
AS3 Global Variables And How To Access Buttons Inside Movieclips
Hi, I am making a simple game and I have an option to change the player appearance.
Problem is I tried to use a variable to detect and change clothes but it doesn't work.
I have already declared the variable using var playerClothes= "normal"; but it seems because the clothes movieclip is in another movieclip, it can't access the variables.
I've tried package to make global variables, but it says my package is unexpected although the code checker says there are no errors. I put the package in the first frame.
I have also the same problem when trying to access a button inside a movieclip it can't find it....
Access Classes Inside A Component Loaded Externally
[RESOLVED: see post below]
Hi again!
[Summary]
I use a component (photoflow) to load some images, everything works fine if the component is placed on the stage of swf called b.swf
also, ther's a main a.swf who loads b.swf, and again, the component works.
NOW: a.swf has a document class a.as, and a function to triger some events as the componenet loads, the component has an internal class so that we can control it (add event listeners) from AS, and we have to write:
ActionScript Code:
import com.flashloaded.as3.PhotoFlowEvent;
if I wrote on the b.swf timeline;
ActionScript Code:
import com.flashloaded.as3.PhotoFlowEvent;myPhotoFlow.addEventListener (PhotoFlowEvent.INIT, eventHandler);function eventHandler (eo:PhotoFlowEvent):void { trace("hello init");}
it works, but if i try to write the same code (modified a littel) on a.as it gives me an error:
ActionScript Code:
1046: Type was not found or was not a compile-time constant: PhotoFlowEvent.
I load the b.swf correctly and i can access some text fields inside it using
ActionScript Code:
product_details_swf.Tel.text = "TEL number shows correctly on b.swf ";
[SYMPTOMS]
This happens only when I try to get the import class inside the b.swf, maybe it's a scope problem!
ActionScript Code:
import product_details_swf.com.flashloaded.as3.PhotoFlowEvent;product_details_swf.myPhotoFlow.addEventListener (PhotoFlowEvent.INIT, eventHandler);function eventHandler (eo:PhotoFlowEvent):void { trace("hello init");}// gives same error
[MORE INFORMATION]
I searched on Adobe, kirupa and google about how to access classes of component which are inside external loaded swf but in vain!
Posted also a comment on the component forum but with no answer.
thanx for any help.
Help On Content Inside Of A Pop Up
Hi,
I have a problem with the content INSIDE the pop up... the web address is
http://www.freewebs.com/pfisch/
The intro plays fine, and then you enter... the pop up pops up, and as you can see the content has this white border on the left side and top... When i do a Html preview in flashmx2004 that border is there too... so my problem is that i want it to be right in the corner, with no white spacing..
Im thinkin this is some kind of publish problem, or document... im not sure
I hope this made sense, if anyone could help me?
thank you
phil
Help On Content Inside Of A Pop Up
Hi,
I have a problem with the content INSIDE the pop up... the web address is
http://www.freewebs.com/pfisch/
The intro plays fine, and then you enter... the pop up pops up, and as you can see the content has this white border on the left side and top... When i do a Html preview in flashmx2004 that border is there too... so my problem is that i want it to be right in the corner, with no white spacing..
Im thinkin this is some kind of publish problem, or document... im not sure
I hope this made sense, if anyone could help me?
thank you
phil
|