createmovieclip not showing movieclips with flvplayer component
i have a flvcomponent on stage and create the thmbnails dynamical by createmovieclip ..whichever image u clip a flv loadsin the player...but the problem is the thmbnails display fine on localhost not online...if i remove the flvcomponent and test it online thmbnails display fine. just cant' figure out the problem.
Gunna guess you have a newer version of flash to me as mine cant open it, on CS3.
Doubt this is of much help though worth a shot:
a) make sure whitespace is ignored, basic though sometimes overlooked: shouldnt cause the issue if loading locally
Code:
xml.ignoreWhite=true;
b) Flash and Xml cannot call information from another domain. The swf, xml and information being called in must be on the same domain. You can get round this via a cross domain xml file. Though you would require an xml file on both domains to do this. (Most likely issue)
yea xmlignore is present and both flashn xml are on same domain...
wheni remove the flvcomponent form the stage and upload the swf the thmbnails load perfectly but with the component they dont and the problem comes only once i upload on local testingboth the flv and images load.
I'm pretty sure you dont use the flvplayback component with NetStream, you need to create a new video instance in your library and drag it to the stage using the name you gave the (now removed)flvplayback component. its different coding for the flv component.
Your code is all over the place like your other project and I don't have time today.
If you can sort out how you actually want things to work, ( flv component or netstream) then things might come to fruition.
You need to clarify how you structure your files, as you have path issues too.
Ok,
delete the flv component off the stage and library, open library, create new video,(actionscript controlled), drag it to the stage and call it myvideo as before.
Then replace all of your code with the below code.
PHP Code:
stop();
var shoplistXML:XML = new XML();
shoplistXML.ignoreWhite = true;
var i:Number = 0;
var j:Number = 0;
var m:Number = 0;
var n:Number = 0;
var count:Number = 0;
var myvideoid:Number = 0;
var catpos:Number = 0;
var categorynum:Array = new Array();
var catname:Array = new Array();
var countitems:Array = new Array();
var catid:Array = new Array();
var smallimgid:Array = new Array();
shoplistXML.onLoad = function(success)
{
if (success)
{
var countcat:Array = shoplistXML.firstChild.childNodes;
var category:Array = shoplistXML.firstChild.childNodes;
for (k = 0; k < countcat.length; k++)
{
var countcatitems:Array = shoplistXML.firstChild.childNodes[k].childNodes;
countitems[k] = countcatitems.length;
smallimg = new Array(countcat.length);
myvideo = new Array(countcat.length);
}
for (i = 0; i < category.length; i++)
{
catname[i] = shoplistXML.firstChild.childNodes[i].attributes.name;
count = countitems[i];
smallimg[i] = new Array(count);
myvideo[i] = new Array(count);
//Create a container to hold all title for categories
_root.createEmptyMovieClip("categorylist",_root.getNextHighestDepth());
categorylist._x = 100;
categorylist._y = 52;
var my_fmt:TextFormat = new TextFormat();
my_fmt.color = 0xFFFFFF;
my_fmt.underline = false;
my_fmt.font = "Arial";
for (m = 0; m < countcat.length; m++)
{
//Create a container for this specific image title
_root.categorylist.createEmptyMovieClip("catname" + m,categorylist.getNextHighestDepth());
_root.categorylist["catname" + m].id = m;
catid[m] = _root.categorylist["catname" + m].id;
//trace (catname[m]);
//Now create a textfield to hold the title information. It will be within the container
_root.categorylist["catname" + m].createTextField("cattext",0,0,0,80,22);
_root.categorylist["catname" + m].cattext.selectable = false;
_root.categorylist["catname" + m].cattext.html = true;
_root.categorylist["catname" + m].cattext.multiline = false;
_root.categorylist["catname" + m].cattext.wordWrap = true;
_root.categorylist["catname" + m].cattext.autoSize = false;
_root.categorylist["catname" + m].cattext.border = false;
_root.categorylist["catname" + m].cattext.color = 0xFFFFFF;
_root.categorylist["catname" + m].cattext.htmlText = catname[m];
_root.categorylist["catname" + m].cattext.setTextFormat(my_fmt);
//Now position this title container within the main imageTitle container
_root.categorylist["catname" + m]._x = 10;
_root.categorylist["catname" + m]._y = 30 * m;
loadmyvideo(catpos,0);
loadsmallimg(catpos,countitems[catpos]);
//Make sure the individual text movieclips have functionality
categorylist["catname" + m].onRelease = function()
{
removeMovieClip(thmblist);
catpos = catid[this.id];
loadmyvideo(catpos,0);
var totalitems:Number = countitems[this.id];
loadsmallimg(catpos,totalitems);
};
}
}
};
shoplistXML.load("shoplist_gallery.xml");
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
myvideo.attachVideo(ns);
function loadmyvideo(cp, bid)
{
_root.createEmptyMovieClip("myvideomc", _root.getNextHighestDepth());
var myvideoname:String = myvideo[cp][bid];
var videofolderloc = "videos/";
var myvideourl = videofolderloc + myvideoname;
ns.play(myvideourl);
}
function loadsmallimg(catposno, smalltotalitems)
{
//Create a container to hold all thmbs for categories
_root.createEmptyMovieClip("thmblist",_root.getNextHighestDepth());
thmblist._x = 50;
thmblist._y = 300;
cLoader = new MovieClipLoader();
mycLoader = new Object();
cLoader.addListener(mycLoader);