Content Of Movieclip
Hi guys, can anybody tell me how to get/trace the content of a movieclip? ex: im loading an image from a mysql database into a targetclip i flash, i do this by calling a php file with a id attached (loadimg.php?id=345), so i don't know the actual name of the image that gets loaded into the targetclip. but i would like to :-) thanks!
KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 04-24-2005, 04:37 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
How To Swap Movieclip With Other Content, In A Movieclip Loaded External
Hi! I'm getting desperated.
I started about 3 days ago trying to solve this problem, maybe i'm very noob!
I have a main movie. Inside this, i load various externals swf's. One swf for a menu, another for a image presentation, etc.
In the menu, i load various instances of another swf file... a button swf, and witch one has to have a different image as button.
So inside the button, i have a layer with a button, but no shape or nothing, and in another layer, i have a movieclip to can swap by an image.
So, the struct is like this:
Main Movie
. image_presentation
. contact
. menu
. . button1
. . . button
. . . image
. . button2
. . . button
. . . image
. . button3
. . . button
. . . image
. . button4
. . . button
. . . image
So, button is only a swf file, with various instances. "button" inside the buttons, make the button efect, with a white border apearing on mouse over button. "image" is a movieclip created only for change with an image (button 1 = image 1, button 2 = image 2, etc).
How can i do this, controlling the images url's from the main movie?? I had tried a lot of ways, but i could do it.
Please help.
Thanks.
MovieClip Content
Hi,
I will like to know if there is a way to know if a movieclip is empty or not, only by using actionscript code.
Wo1olf.
mywebsite
Content Of Movieclip
Hi guys, can anybody tell me how to get/trace the content of a movieclip?
ex: im loading an image from a mysql database into a targetclip i flash, i do this by calling a php file with a id attached (loadimg.php?id=345), so i don't know the actual name of the image that gets loaded into the targetclip. but i would like to :-)
thanks!
Loading Content From One Movieclip To Another?
Hello all!
ok heres the deal. I have a bunch of images in a movieclip attached to a scrollpane. When an image is clicked, I want to "copy" the image selected and open it in a movieclip on the main stage. I have no idea how to accomplish this. and help is appreciated.
MASK Movieclip With Xml Content
Hi
I have a movie clip that has imported xml in its text boxes, when i try to mask this MC with a rectangle, it doesnt show the xml loaded text boxes!! but it does show other elements like graphics in the MC.
how can i fix this? im using AS2
thanks
Clearing Content From Movieclip
Is there a way that you can clear everything that has been added to a movie clip easily?
Basically want to remove all textfields, fills, lines etc so the entire clip is blank without actually removing the clip.
Please Help On The Loader.content To Movieclip
Hello there,
I have been search around and got some mixed solutions, summarized as follow:
If I need to load external swf into the main swf file, I need to Loader with appropriate URLRequest for this purpose.
After loaded, you can listen to the complete event and addChild the loader.content to the main swf.
Because I have a stop on the loaded swf first frame, I need to start the swf with a button. Some solutions on the net pointed that to make this happened, you need to cast the loader.content to MovieClip and have to through a tricky way to accomplish it like
var movie:*=loader.content ;
var clip:MovieClip=movie;
clip.gotoAndPlay(4);
.....
I tried this method and still got Type Coercion failed ::cannot convert flash.display to MovieClip
Please help, don't know why some experts said it is working while I can not get it to work. Thanks in advance
From Loader To Movieclip And Other Content
Hello all!
I wonder if someone knows about this.
I have an XML-file which holds some info about picture and text.
A designer have made some mc's and I have to load the pictures (which has URL from XML) into this mc-animation.
I can only load the images into the loader and then I'm totally lost, I cant get the image from the loader in memory into the animated timeline mc. Any clue to how this is done? I have tried addChild but this doesnt help me attach the loaded picture to the anim_mc. or...?
The designer also have a textlayer, which is put in a mc and then animated. And the text from XML must go into the textfield and be animated.
any hint would be very appreciated. There must be some kind of command I don't know or have overlooked.
//Thanks
Peter
Change Movieclip Content
Hi
what's the actionscript for changing a movie in a movieclip, a movieclip from the library , not loading an external .swf!
a command like "swap"...
regards, henrik
Delete All Content Of A Movieclip
How do I, in actionscript, say "delete all content of a movieclip"?
there doesn't seem to be a function called
" _root.movieclipname.deleteContent(); "
I know an awkward way of doing it; deleteing the movieclip and replicating it in the same coordinates with the same name, but this is a terrible way of doing it..
how is it then? please help, thanks
Cannot Load New Content Into Movieclip
hi there,
the under-mentioned code is a small app i've started today. the xml is loaded successfully. the first image and its title are displayed after loading. everything's fine so far.
my problem is that i don't get the second image to load into my movieclip i get the correct node though.
thanks for your help.
Code:
var myLoader:URLLoader = new URLLoader();
var myURL = new URLRequest("hot.xml");
myLoader.load(myURL);
myLoader.addEventListener(Event.COMPLETE, onLoadComplete);
function onLoadComplete(evt : Event):void {
var myXML:XML;
XML.ignoreComments = true;
XML.ignoreWhitespace = true;
myXML = new XML(myLoader.data);
//gets first auction element out of xml for correct browsing
var aucNr = myXML.Auctions.Auction.length();
var actualNode = 0;
var actualAuction = myXML.Auctions.Auction[actualNode];
getAuc();
function getAuc():void {
//inserts actual auction image
var aucImage = actualAuction.Pictures.Small.toString();
var imgReq:URLRequest = new URLRequest(aucImage);
var imgLoader:Loader = new Loader();
imgLoader.load(imgReq);
images_mc.addChild(imgLoader);
//inserts actual auction title
var aucTitle:String = actualAuction.Title.toString();
aucTitleField.text = aucTitle;
}
//browse articles out of xml
arrRight_btn.addEventListener(MouseEvent.CLICK, nextAuc);
function nextAuc(event:MouseEvent):void {
actualNode++;
getAuc();
}
//browse articles out of xml
arrLeft_btn.addEventListener(MouseEvent.CLICK, prevAuc);
function prevAuc(event:MouseEvent):void {
actualNode--;
getAuc();
}
}
Hier noch das XML:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<AuctionListing CountryNr="2" CurrencyNr="2" CurrentDate="7/12/2007 11:15:50 AM">
<Categories MotherCategoryNr="1">
<Category CategoryNr="38399" CategoryName="Antiquitäten & Kunst" NbItems="61"/><Category CategoryNr="38488" CategoryName="Audio & HiFi" NbItems="106"/><Category CategoryNr="38567" CategoryName="Auto & Motorrad" NbItems="607"/><Category CategoryNr="38766" CategoryName="Briefmarken" NbItems="147"/><Category CategoryNr="38889" CategoryName="Bücher & Comics" NbItems="17"/><Category CategoryNr="39037" CategoryName="Büro & Papeterie" NbItems="40"/><Category CategoryNr="39091" CategoryName="Computer & Netzwerk" NbItems="303"/><Category CategoryNr="39349" CategoryName="Filme & DVD" NbItems="158"/><Category CategoryNr="39460" CategoryName="Foto & Optik" NbItems="80"/><Category CategoryNr="39563" CategoryName="Games & Software" NbItems="199"/><Category CategoryNr="39735" CategoryName="Grosshandel & Gewerbe" NbItems="71"/><Category CategoryNr="39825" CategoryName="Handwerk & Garten" NbItems="105"/><Category CategoryNr="39940" CategoryName="Handy, Festnetz, Funk" NbItems="331"/><Category CategoryNr="40295" CategoryName="Haushalt & Wohnen" NbItems="226"/><Category CategoryNr="40520" CategoryName="Kind & Baby" NbItems="89"/><Category CategoryNr="40748" CategoryName="Kleidung & Accessoires" NbItems="98"/><Category CategoryNr="41057" CategoryName="Kosmetik & Pflege" NbItems="30"/><Category CategoryNr="41126" CategoryName="Modellbau & Hobby" NbItems="158"/><Category CategoryNr="41260" CategoryName="Münzen" NbItems="117"/><Category CategoryNr="41306" CategoryName="Musik" NbItems="22"/><Category CategoryNr="41432" CategoryName="Musikinstrumente" NbItems="45"/><Category CategoryNr="41518" CategoryName="Sammeln & Seltenes" NbItems="117"/><Category CategoryNr="41733" CategoryName="Spielzeug & Basteln" NbItems="88"/><Category CategoryNr="41875" CategoryName="Sport & Reisen" NbItems="128"/><Category CategoryNr="42099" CategoryName="Tickets & Gutscheine" NbItems="173"/><Category CategoryNr="42135" CategoryName="Tierwelt" NbItems="28"/><Category CategoryNr="42196" CategoryName="TV, Video & Elektronik" NbItems="76"/><Category CategoryNr="42272" CategoryName="Uhren & Schmuck" NbItems="159"/><Category CategoryNr="42454" CategoryName="Wein & Genuss" NbItems="106"/>
</Categories>
<Auctions AuctionCount="250" TotalAuctionCount="3355">
<Auction AuctionNr="511478142" IsPremium="0" IsHeadOfListing="0" IsBold="0" IsFluo="0" StartDate="7/6/2007 9:38:00 AM" EndDate="7/16/2007 9:38:00 AM" NbBids="401" Catg="42247">
<Pictures PictureInListing="1">
<Small>http://images.qxlricardo.com/ImgUsers/5/511/51147/5114781/511478142_v1_prem.jpg</Small>
<Normal>http://images.qxlricardo.com/ImgUsers/5/511/51147/5114781/511478142_v1.jpg</Normal>
<Big>http://images.qxlricardo.com/ImgUsers/5/511/51147/5114781/511478142_v1_Big.jpg</Big>
</Pictures>
<Link>http://my.ricardo.ch/accdb/viewitem.asp?IDI=511478142</Link>
<LinkXML>http://my.ricardo.ch/accdb/viewitemXML.asp?IDI=511478142</LinkXML>
<Title>JVC EVERIO GZ-MG134 EF - Disque dur 30GB - Neuf/Non ouvert!</Title>
<Prices CurrentPrice="456" ReservePrice="0" BuyNowPrice="730"/>
</Auction>
<Auction AuctionNr="511589684" IsPremium="0" IsHeadOfListing="0" IsBold="1" IsFluo="1" StartDate="7/8/2007 1:25:00 PM" EndDate="7/14/2007 1:25:00 PM" NbBids="361" Catg="37263">
<Pictures PictureInListing="1">
<Small>http://images.qxlricardo.com/ImgUsers/5/511/51158/5115896/511589684_prem.jpg</Small>
<Normal>http://images.qxlricardo.com/ImgUsers/5/511/51158/5115896/511589684.jpg</Normal>
<Big>http://images.qxlricardo.com/ImgUsers/5/511/51158/5115896/511589684_Big.jpg</Big>
</Pictures>
<Link>http://my.ricardo.ch/accdb/viewitem.asp?IDI=511589684</Link>
<LinkXML>http://my.ricardo.ch/accdb/viewitemXML.asp?IDI=511589684</LinkXML>
<Title>Ford Escort XR3 i 16V AB 10.-</Title>
<Prices CurrentPrice="504" ReservePrice="0"/>
</Auction>
<Auction AuctionNr="511235456" IsPremium="0" IsHeadOfListing="0" IsBold="0" IsFluo="1" StartDate="7/2/2007 2:56:00 PM" EndDate="7/12/2007 2:56:00 PM" NbBids="325" Catg="41504">
<Pictures PictureInListing="1">
<Small>http://images.qxlricardo.com/ImgUsers/5/511/51123/5112354/511235456_prem.jpg</Small>
<Normal>http://images.qxlricardo.com/ImgUsers/5/511/51123/5112354/511235456.jpg</Normal>
<Big>http://images.qxlricardo.com/ImgUsers/5/511/51123/5112354/511235456_Big.jpg</Big>
</Pictures>
<Link>http://my.ricardo.ch/accdb/viewitem.asp?IDI=511235456</Link>
<LinkXML>http://my.ricardo.ch/accdb/viewitemXML.asp?IDI=511235456</LinkXML>
<Title>Micro Korg Synthesizer Vocoder + MIDI Interface Steinberg</Title>
<Prices CurrentPrice="350.2" ReservePrice="0" BuyNowPrice="799"/>
</Auction>
<Auction AuctionNr="511371836" IsPremium="0" IsHeadOfListing="0" IsBold="0" IsFluo="0" StartDate="7/4/2007 1:09:00 PM" EndDate="7/14/2007 1:09:00 PM" NbBids="274" Catg="41995">
<Pictures PictureInListing="0">
<Small>http://images.qxlricardo.com/ImgUsers/5/511/51137/5113718/511371836_prem.jpg</Small>
<Normal>http://images.qxlricardo.com/ImgUsers/5/511/51137/5113718/511371836.jpg</Normal>
<Big>http://images.qxlricardo.com/ImgUsers/5/511/51137/5113718/511371836_Big.jpg</Big>
</Pictures>
<Link>http://my.ricardo.ch/accdb/viewitem.asp?IDI=511371836</Link>
<LinkXML>http://my.ricardo.ch/accdb/viewitemXML.asp?IDI=511371836</LinkXML>
<Title>Swiss Map 25; Sektor 6 -Ostschweiz - DVD (NP 178,--)</Title>
<Prices CurrentPrice="100.05" ReservePrice="0" BuyNowPrice="150"/>
</Auction>
</Auctions>
</AuctionListing>
Unload Content Of A MovieClip
Hi!
I have 4 MC working as a button and when I click one of them I want to unload the content of a MC that I use to load external's MovieClips and load a new one inside this "stage" MovieClip. I am using a function that recieves which external swf to load.
My question is how to unload the previous content of the empty movie clip?
Here is my function:
Code:
function loadSWF(swf:String) : void
{
var loader : Loader = new Loader();
var url : URLRequest = new URLRequest(swf)
loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,onProgress);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE,onComplete);
loader.load(url);
mainBox.holder.addChild(loader);
}
Checking Content Of A Movieclip...(help)
Hey everyone (anyone?)
I have this setup, where i load some .swf's into some empty MC's. Is there anyway to check
the content of these MC's, so that the external .swf only gets loaded if the MC is empty?
I'll be a much happier person, if someone could help out...
cheers
Change Movieclip Content
Hi
what's the actionscript for changing a movie in a movieclip, a movieclip from the library , not loading an external .swf!
a command like "swap"...
regards, henrik
Dupplicate A MovieClip And Its Content
I wonder if there's a way to duplicate a MovieClip created dynamicaly and its content.
For example:
--------------------
this.createEmptyMovieClip("Photo", 1);
Photo.loadMovie("image.jpg");
Photo.duplicateMovieClip("Photo2", 2);
--------------------
This code does not duplicate the content but only an empty MovieClip.
But it works if instead of creating the empty MovieClip Photo, i create it by the hand in Flash and put the image in it.
Can someone tell me if it's possible to do that in actionscript?
Thank you in advance,
Christophe
Movieclip & Dynamic Content
Would this be considered dynamic content?
CODE// MC_template is in the library, exported for
// actionscript, and also created in the first frame, but
// is 'hidden'.
this.attachMovie("MC_template", "thisInstance", this.getNextHighestDepth()).loadMovie("SomeImgURL");
Hiding Offstage Content In Movieclip
Hello!
I'm trying to make numerous movie clips that will require offstage content to motion tween across a 60 pixel by 60 pixel stage. When I publish a sample movieclip, the resulting .swf shows all content, in essence extending the stage beyond 60 x 60. However, if I do a publish preview (HTML), the movieclip shows only the desired "acreage".
All of the tutorials/books I have read indicate that only the predetermined stage size will actually be published.
What am I missing? I have tried altering the load order in the publish settings from "bottom-up" to "top-down", but this doesn't help.
Any advice offered will be graciously accepted and appreciated!
Eric
Copying A Movieclip With Dynamic Content
Okay, - I have a movieclip that contains a jpg that I have loaded dynamically via myClip.loadMovie("myJpg.kpg", 1)
Then about 10 frames later I have another clip that I would like to be a copy of the first clip, - only with the dynamic content!!, - so it should'n be a perfect copy of the original clip, but a copy of the clip WITH the new grafix, - how is this possible, if its possible at all?
Regards
Godowsky
Movieclip > Preloader > Content Problems...
movieclip > preloader > content
this structure is set up in 1 scene, over 3 frames in my .fla. the first movieclip plays fine, then moves onto the preloader. the preloader then plays fine (apart from starting halfway, which makes it look clumsy) but doesnt move onto the next frame. this only happens when i upload it or preview it with streaming. if i preview it as normal it bypasses the preloader and goes straight to the content frame. if anyone could help be it would be greatly appreciated.
cheers
jh
Duplicate MovieClip With Dynamic Content
I would like to duplicate a movie clip that has dynamically loaded content (SWF/JPEG) inside of it. Since I cannot do this (I think), is there a way to load a SWF once than replicate that SWF without having to download it x times?
How Do I? Content In Movieclip On Main Timeline
I've decided that since my entire movie is going to be so small there is no point in making multiple swf's and load the content from them. I would much rather just put the content into individual movie clips that I place on the main timeline. That would also allow me to have the main timeline be no more then 3 frames long including the preloader. I have seen this done but I am not entierly sure how to do it. More spesifically how do I program my button to load and unload the spesific movieclips that I create?
thx in advance.
Resizing Movieclip Without Scaling Content?
Hi!
Is there a way to scale a movieclip without scaling the content within that clip?
I'm working on a site where I want to use a scroll area that has different height depending on resolution. Now when I put text inside the text gets streched vertically... Is there a way to prevent that from happening? The same will apply to pics placed inside the movieclip...
If I use a textfield instead of just typing directly inside the movieclip the text is scaled keeping the correct dimensions but I want the text to stay at a constant size...
Niklas
My Content Resizes When Loading Into Movieclip
Hey Everyone.
I have som external swf's that I'm loading into a movieclip, that I have created with the createEmptyMovieClip... My content is then loaded into this with the loadMovie. It works, but my content resizes. I have just drawed a rectangle and it's twice the size when it is loaded into the movieclip.
Why does it do this, and waht can I do?
Export The Content Of A Movieclip In A Jpeg
Hi
I would like to know if some AS3 functions exist to copy the content of a movieclip and then export it in a php file to get it in a jpeg format?
Do you have any ideas or do you know some script to do that?
I can't find it myself
many thanks for your help
Scrollpane And Movieclip Content Not Scrolling
[resolved...]
I have a movieclip in my library and this movie clip, i have it call an xml which in terms defines some images to draw inside this movie clip.
So on the main timeline, i created a scrollpane, and loaded this movieclip. The movieclip loads just fine, the problem is, its not scrolling, the content clearly overflows inside the scrollpane but the scrollbar does not automatically show up.
I've used the .load and .source method of the scrollpane but same results.
What might be the issue?
I tried adding an event listener when content of scrollpane has loaded but it seems the event listerner never fires... (event.complete) strange...
Ok so my specific question is , how do I or can I add items from within the source mc such that it will be added on the same level as the scrollpane. So within the movie clip which stored in the library, id probably want to do this.parent.addChild(thingtoadd); i guess id have to name the scrollpane.... thanks or your help..l..
Scroll Movieclip With Dynamic Content Help
I have a movicelip that loads in information from an xml file. I have been looking all over the place for a scrollbar component that works with this and nothing works. Ultimatr scroller doesn't and I tried some other ones, none of them seem to work with the dynamic info. So, can anyone lead me in a direction that has worked for them in the past?
Export The Content Of A Movieclip In A Jpeg
Hi
I would like to know if some AS3 functions exist to copy the content of a movieclip and then export it in a php file to get it in a jpeg format?
Do you have any ideas or do you know some script to do that?
I can't find it myself
many thanks for your help
Scroll A Dynamique Content Movieclip
hello,
so here is my problem, i made a flash animation that is feed from a mysql database, the number of records may be to much to be seen on the stage, so i think that i must have a scroll bar , ad instead of having the content of my animation on the main scene,i put it on a symbol, and then put everything on the main scene,
the problem is that its not working, because i have a loop on the beginning of my movielclip that make a refresh for getting live data from a php queries,
the files are here,files
if anyone can help me ,i will really appreciate.
tanks a lot
Scrolling Movieclip With Dynamic Content
Hello,
Here i've got a fla file i have made. It get's the variables from a html page (it normally gets the variables from an asp page but i have changed it for now just to a html page to see what's going on.) After that it puts a cross or a check mark in front of the person. But there are like 9 people who has a cross or a check mark infront of his name(teller is the counter it gives 9). But somehow i can't scroll down to see the rest of it. Does someone know how to fix this problem?
Thanks in advance.
(i have used MX 2004)
Dynamic Content MovieClip Scroll
Hi all,
I was wondering if someone could take a look at my fla and see if they can get the scroller to work.
I've tried everything!
It scrolls if there is something already in the content area but if content is loaded dynamically, as it is here, it doesn't work.
http://www.buildrebuild.com/scrollNotWorking.rar
You need the FLA and the XML file.
Thanks for any help and advice.
BRb
Export The Content Of A Movieclip In A Jpeg
Hi
I would like to know if some AS3 functions exist to copy the content of a movieclip and then export it in a php file to get it in a jpeg format?
Do you have any ideas or do you know some script to do that?
I can't find it myself
many thanks for your help
Scrolling Movieclip With Dynamic Content
Hello,
Here i've got a fla file i have made. It get's the variables from a html page (it normally gets the variables from an asp page but i have changed it for now just to a html page to see what's going on.) After that it puts a cross or a check mark in front of the person. But there are like 9 people who has a cross or a check mark infront of his name(teller is the counter it gives 9). But somehow i can't scroll down to see the rest of it. Does someone know how to fix this problem?
Thanks in advance.
(i have used MX 2004)
Trouble Linking Content Within Attached Movieclip
Ok, so as the title indicated I am having trouble linking a flv file with a playback component via actionscript. Here's a breakdown of what's going on:
At the root level I have attached a movieclip named Navigation. Inside of Navigation is a button that attaches another movieclip, named List, also at the root level. Inside of List is another button that attaches a third movielcip, named Movie.
Inside of Movie is an FLVPlayback component, instance name Player, with no content linked. The code for the button in List is as follows:
on (release) {
_root.attachMovie("movie", "movie1", 3);
_root.movie1._x = 250;
_root.movie1._y = 0;
_root.movie1.player.contentPath= "http://home.comcast.net/~ptgerke/one.flv"
}
So the button in List successfully attaches Movie, and positions it correctly, but the FLVPlayback component, Player, never establishes connection with the flv file that I tried to direct it to.
Is there something simple that I'm messing up on?
Thanks for the help, and sorry if I didn't do a well enough job describing the situation. Let me know and I can further clarify or provide the .fla file or something.
Thanks
Pat
MovieClip Won't Resize To Content; In This Case, TextField
I have a MovieClip with dynamic text inside. Initially, it has one line of text and the MovieClip's height is a certain value. However, when I dynamically change the text to include additional lines, the height of the MovieClip remains the same!
How can I get the MovieClip to adjust its height accordingly???
ActionScript Code:
myMovieClip.textField.htmlText = '<![CDATA[bla bla bla
bla bla bla
bla bla bla
bla bla bla]]>';
myMovieClip.height // height remains unchanged
HitTest Only The Content Of Movieclip And Not From 0,0 To _width, _height?
Hey guys
This is probably just a brainfart but when I publish the code below, my hitTest is triggered by the entire movieclip from 0,0 to _width, _height and not by it’s content.
The “fwa” movieclip contains some txt that I broke apart, and I only want the hitTest to run when the “mc” hits the txt within the “fwa” movieclip!
ActionScript Code:
var i:Number = 0;var count:Number = 0;var colorArr = ["0x99cc33", "0xff0066", "0xffcc00", "0x33ccff"];this.onEnterFrame = function(){ mc = this.createEmptyMovieClip("mc"+i, this.getNextHighestDepth()); mc.attachMovie("circle", "circle", mc.getNextHighestDepth()); mc._x = Math.random()*Stage.width; mc._y = Math.random()*Stage.height; mc._xscale = mc._yscale = Math.random()*150; mc._alpha = 20+Math.random()*80; var my_color:Color = new Color(mc); if(mc.hitTest(fwa)) { my_color.setRGB(0xFFFFFF); } else { my_color.setRGB(colorArr[count]); } count++; i++ if(count == colorArr.length){ count = 0 } }
Hope somebody can give me a hint here
Scrollpane Inside Attached Movieclip Not Loading Content
hi folks,
I have a movieclip in my library that contains a scrollpane.
I attach this movieclip to the stage using attachMovie.
I then wish to populate this scrollpane with another movieclip in the library.
It seems that I can only get this to work if i delay the request to populate the scrollpane be either using an interval or some delayed event.
It would appear that I need to first be sure that the first attached movie clip is fully loaded before I can populate the scrollpane it contains (i think)
Whats the right way to do this? I don't want to guess when its "ok" to add content to my scrollpane as this may not be the same on every system. It looks like using "onLoad" with an external class as suggested in the Docs would be a solution, but it seems a bit convoluted and I have yet to get it to work properly.
I'm using flash 8 pro.
please help.
[F8] Call Movieclip Using Variable, Not Instance Name: This[variablename].content
Hello there.
Actionscript: 2.0
Flash: 8.0
I want to access a movie clip by using a variable value, not using it's name.
this[variablename].conteudoFinal = "<font color='#185c70'>"+titulo+"</font> "+textopequeno+"<br><br>";
The problem is this:
If i use the ABSOLUTE reference to the movie clip, like this
_root.texto.contentMain[duplicacao].conteudoFinal = "<font color='#185c70'>"+titulo+"</font> "+textopequeno+"<br><br>";
it works fine.
The problem is this is an external SWF wich will be loaded into a main swf in a movie clip, so the _root would not work anymore.
I have tried this[variablename].conteudoFinal = "<font color='#185c70'>"+titulo+"</font> "+textopequeno+"<br><br>";
it doesn't put anything on the variable of the textfield called conteudoFinal.
However, the variable titulo and textopequeno have values inside. I've traced them.
Any help?!
Thanks in advance!!
Ricardo
Scrollpane Inside Attached Movieclip Not Loading Content
hi folks,
I have a movieclip in my library that contains a scrollpane.
I attach this movieclip to the stage using attachMovie.
I then wish to populate this scrollpane with another movieclip in the library.
It seems that I can only get this to work if i delay the request to populate the scrollpane be either using an interval or some delayed event.
It would appear that I need to first be sure that the first attached movie clip is fully loaded before I can populate the scrollpane it contains (i think)
Whats the right way to do this? I don't want to guess when its "ok" to add content to my scrollpane as this may not be the same on every system. It looks like using "onLoad" with an external class as suggested in the Docs would be a solution, but it seems a bit convoluted and I have yet to get it to work properly. (for example, how do you pass to the class constructor a reference to a scrollpane thats contained within the same movieclip thats being attached within the line of code that instantiates said class and its associated movieclip...confused? me to!)
please help.
Centering Content Inside A Dynamically Created Movieclip
Like the title says, I'm having trouble to center any dynamic content (movieclips, textfields...) inside a dynamically created movieclip, which has a default point of interested in the top left corner.
Do you have any solutions?
Thanks
PS: Just as an example, I have a dynamically created text field inside a dynamically created movieclip....and when I try to scale that movieclip I need to scale it from its center
External Content Loader With Multiple Content Types (trouble Loading Graphics)
Hey all!
I am yet another new project. Our flash designer here isn't a big AS guy, and asked me to write a reusable class so that he can load a variety of content types using minimal amount of code on his part. It's also going to be the main component piece in a larger external content player once I'm done with the class itself, so I am making the loading functions into public methods of the loader object than can be called from a button, etc.
I have the code for the text and html parts working (although I can't get stage.width and stage.height to work in the class or from the frame).
The problem I have is that I can't get the graphics content to load (the swf/pic content). Could you please check my code and tell me what I'm missing? I'm sure it's something simple, like it always is.
thanks a million!
-Fish
-----------------------------
ActionScript Code:
package
{
/**
* External Multimedia Loader Class
* @author $(DefaultUser)
* Add new MultiLoader object and insert media type (all lowercase) and object path to control initial loaded object
* To load a new object, call the MultiLoader.load* methods (loadText, loadPic, loadSwf, or loadHtml as appropriate), passing the path to the external file.
*/
import flash.display.*;
import flash.events.*;
import fl.transitions.*;
import fl.transitions.easing.*;
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.text.TextField;
public class MultiLoader extends MovieClip
{
private var media:String;
private var path:String;
public var textObj:TextField = new TextField;
public var picObj:MovieClip = new MovieClip;
public var swfObj:MovieClip = new MovieClip;
public var htmlObj:TextField = new TextField;
private var objLoader:Loader = new Loader();
private var objType:String;
private var textLoader:URLLoader = new URLLoader();
public function MultiLoader(mediaType:String,objPath:String)
{
media = mediaType;
path = objPath;
if (media == "text" || media == "TEXT" || media == "Text")
{
loadText(objPath);
}
else if (media == "pic" || media == "PIC" || media == "Pic")
{
loadPic(objPath);
}
else if (media == "swf" || media == "SWF" || media == "Swf")
{
loadSwf(objPath);
}
else if (media == "html" || media == "HTML" || media == "Html")
{
loadHtml(objPath);
}
else
{
trace("ERROR: Media type not supported. Media type must be 'text', 'pic', 'swf', or 'html'.");
}
}
public function loadText(txtPath):void
{
objType = "text";
if (this.numChildren > 0)
{
this.removeAllChildren();
}
this.addChild(textObj);
this.textLoader.load(new URLRequest(txtPath));
this.textObj.wordWrap = true;
this.textObj.multiline = true;
this.textLoader.addEventListener(Event.COMPLETE, addTextContent);
//this.textObj.width = this.width;
//this.textObj.height = this.height;
}
public function loadPic(picPath):void
{
trace("loadPic started");
objType = "pic";
if (this.numChildren > 0)
{
this.removeAllChildren();
}
this.addChild(picObj);
this.objLoader.addEventListener(Event.COMPLETE, addObjLoader);
this.objLoader.load(new URLRequest(picPath));
trace("loadPic completed");
}
public function loadSwf(swfPath):void
{
trace("loadSwf started");
objType = "swf";
if (this.numChildren > 0)
{
this.removeAllChildren();
}
this.addChild(swfObj);
this.objLoader.addEventListener(Event.COMPLETE, addObjLoader);
this.objLoader.load(new URLRequest(swfPath));
trace("loadSwf completed");
}
public function loadHtml(htmlPath):void
{
objType = "html";
if (this.numChildren > 0)
{
this.removeAllChildren();
}
this.addChild(htmlObj);
this.textLoader.load(new URLRequest(htmlPath));
this.htmlObj.wordWrap = true;
this.htmlObj.multiline = true;
this.textLoader.addEventListener(Event.COMPLETE, addTextContent);
}
private function removeAllChildren():void
{
if (objType == "pic")
{
this.picObj.removeChild(objLoader);
}
else if (objType== "swf")
{
this.swfObj.removeChild(objLoader);
}
else
{
trace("objType != 'pic' or 'swf.' objType = '" + objType + "'.");
}
while ( this.numChildren > 0 )
{
this.removeChildAt(0);
}
}
private function addObjLoader(event:Event):void
{
trace("addObjLoader started");
if (objType == "pic")
{
trace("trying to load pic");
this.picObj.addChild(this.objLoader);
this.picObj.objLoader.removeEventListener(Event.COMPLETE, addObjLoader);
}
else if (objType== "swf")
{
trace("trying to load swf");
this.swfObj.addChild(this.objLoader);
this.swfObj.objLoader.removeEventListener(Event.COMPLETE, addObjLoader);
}
else
{
trace("ERROR: Cannot add object loader. The 'objType' variable does not contain correct media type. The function 'addObjLoader' should only be called when objType is 'pic' or 'swf'. In this case, objType is '" + objType + "' .");
}
trace("addObjLoader completed");
}
private function addTextContent(event:Event):void
{
if (objType == "text")
{
this.textObj.text = event.target.data as String;
this.textLoader.removeEventListener(Event.COMPLETE, addTextContent);
}
else if (objType == "html")
{
this.htmlObj.htmlText = event.target.data as String;
this.textLoader.removeEventListener(Event.COMPLETE, addTextContent);
}
else
{
trace("ERROR: Cannot add text content. The 'objType' variable does not contain correct media type. The function 'addTextContent' should only be called when objType is 'text' or 'html'. In this case, objType is '" + objType + "' .");
}
}
}
}
Help Needed In Clearing The Content Of The XML File Content Displayed In The Flash
I have developed a flash file with combo box which displayes all the XML files in the directory and after selecting a particular XML file the flash file reads the XML file and displayes the content of the XML file in flash in a fashion I have done. But, if I chose another XML file which is a blank XML file, still the flash file shows the previous file's content in the flash. How to clear that previous file's content?
If I chose someother XML file which is having some content then it shows correctly. But, if I chose some blank XML file, the flash file shows the previous content instead of showing it blank. pls help me how to clear the previous file contents?
Why Does Flash Re-load Content When Content Within Hidden/shown Area?
Hi all,
A purely academic question for someone about how Flash loads. I've written a simple Flash image scroller script, see: http://www.benjaminkeen.com/software/image_scroller/
On the page above, I separated the various content (installation instructions, demo, download file, etc) into separate pages, which get hidden/shown via JavaScript. Very straightforward.
My question is: why, when you go from the "Overview" to "A few examples" sections (both of which have a demonstration scroller), does the flash get "re-drawn" each time? I don't understand - I thought that it would simply get loaded the first time the browser calls it - not every time the content becomes display:blocked through javascript...?
I guess my follow up question is: can this be prevented?
Scroll Pane Content - Accessing Values Within Content Mc
hey all -
i'm having a bit of a problem. i need to access the .text value of various text fields within a mc that is presented in a scroll pane. i need to check the value against another value, and i'm having trouble grabbing it.
here's what's not working:
//within a for loop where "i" is incrementing
myContent = scroll_pane.getScrollContent();
myText = eval(myContent + ".text" + i +"_txt");
trace (myText.text);
when I run this, myText ends up equal to: _level0.scroll_pane.tmp_mc.text10_txt
where i=10 in this case (all the others increment no problem)
however, if I trace (myText.text) I get nothing (not undefined, just nothing). however, if i forcibly trace(_level0.scroll_pane.tmp_mc.text10_txt.text), it will show me the .text of this text field.
any ideas as to what is happening here?
thanks
oh - flash mx on os x
Hiding/Masking Off-stage Content (external Content)
Hi,
I'm loading an image gallery into another movie. The image gallery itself uses XML to generate a row of thumbnails dynamically. In it's own player, this is fine, but when loaded into the larger movie, the row of thumbnails extends far beyond the container clip.
I've set the size of the container clip with an onLoad function, but I have no idea how to appropriately mask it so there is no spillover. Using a mask in the gallery clip doesn't work because the gallery is 100% scripted (unless I'm missing something terribly basic).
Is there a general method to use, aside from creating infinitely large opaque boundaries around the stage?
Thanks for any tips or insight!
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!!
Content-Length Of Mp3 Not Receving Form Content Server
Hi,
we have develop one course using flash player 7 and action script 1.0 in macromedia flash. In this course we are facing one problem with mp3 file. we have used sound object to load external MP3 files. When these files are downloaded from content server we are not reciving content-length for this file in IE 6 + Flash player 8. If anybody knows the solution for this problem Please help me.
thsnks in advance..........
Not Reciving Content-length Of Mp3 File From Content Server
Hi,
we have develop one course using flash player 7 and action script 1.0 in macromedia flash. In this course we are facing one problem with mp3 file. we have used sound object to load external MP3 files. When these files are downloaded from content server we are not reciving content-length for this file in IE 6 + Flash player 8. If anybody knows the solution for this problem Please help me.
thsnks in advance..........
|