A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: createmovieclip not showing movieclips with flvplayer component

  1. #1
    Senior Member
    Join Date
    Apr 2009
    Posts
    117

    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.

    anyone?

  2. #2
    Senior Member
    Join Date
    Apr 2009
    Posts
    117
    this is the fla and the xml
    Attached Files Attached Files
    Last edited by glassfairy; 01-31-2013 at 05:19 PM.

  3. #3
    Senior Wabbit
    Join Date
    Jul 2008
    Location
    Winchester, Uk
    Posts
    215
    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)

    Hopefully this helps

    Trust my code, and not my english.

  4. #4
    Senior Member
    Join Date
    Apr 2009
    Posts
    117
    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.

  5. #5
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    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.

  6. #6
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    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 (
    0countcat.lengthk++)
            {
                var 
    countcatitems:Array = shoplistXML.firstChild.childNodes[k].childNodes;
                
    countitems[k] = countcatitems.length;
                
    smallimg = new Array(countcat.length);
                
    myvideo = new Array(countcat.length);
            }

            for (
    0category.lengthi++)
            {
                
    catname[i] = shoplistXML.firstChild.childNodes[i].attributes.name;

                
    count countitems[i];

                
    smallimg[i] = new Array(count);
                
    myvideo[i] = new Array(count);

                for (
    0countj++)
                {
                    
    smallimg[i][j] = category[i].childNodes[j].childNodes[0].firstChild.nodeValue;
                    
    myvideo[i][j] = category[i].childNodes[j].childNodes[1].firstChild.nodeValue;
                }
            }

            
    //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 (
    0countcat.lengthm++)
            {
                
    //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(cpbid)
    {
        
    _root.createEmptyMovieClip("myvideomc"_root.getNextHighestDepth());
        var 
    myvideoname:String myvideo[cp][bid];
        var 
    videofolderloc "videos/";
        var 
    myvideourl videofolderloc myvideoname;
        
    ns.play(myvideourl);
    }

    function 
    loadsmallimg(catposnosmalltotalitems)
    {
        
    //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);

        for (var 
    0smalltotalitemss++)
        {
            
    _root.thmblist.createEmptyMovieClip("thmbname" s,s);
            
    _root.thmblist["thmbname" s].id s;
            var 
    smallimgname:String smallimg[catposno][s];
            var 
    smallfolderloc:String "small/";
            
    smallimgid[s] = _root.thmblist["thmbname" s].id;
            var 
    smallimgurl:String smallfolderloc smallimgname;
            
    cLoader.loadClip(smallimgurl,_root.thmblist["thmbname" s]);
        }
        
    cLoader.onLoadStart = function()
        {
            
    _root.thmblist["thmbname" n]._visible false;
        };
        
    cLoader.onLoadProgress = function()
        {
            
    _root.thmblist["thmbname" n]._visible false;
        };
        
    cLoader.onLoadComplete = function()
        {
            
    _root.thmblist["thmbname" n]._visible false;
        };
        
    cLoader.onLoadInit = function()
        {
            for (var 
    0smalltotalitemsn++)
            {
                
    _root.thmblist["thmbname" n]._visible true;
                
    _root.thmblist["thmbname" n].forceSmoothing true;
                
    _root.thmblist["thmbname" n].id n;
                
    _root.thmblist["thmbname" n]._y 0;
                
    _root.thmblist["thmbname" n]._x 100 n;
                
    _root.thmblist["thmbname" n].onPress = function()
                {
                    
    //trace(this.id);
                    
    myvideoid smallimgid[this.id];
                    
    loadmyvideo(catposno,myvideoid);
                };
            }
        };

    the path issues have been altered too, you had an extra / at the beginning

  7. #7
    Senior Member
    Join Date
    Apr 2009
    Posts
    117
    aaah i was using flvcomponent with netstream hence was not working...but instead of newvideo ifiwantto use the flvcomponent then how do i use it?

  8. #8
    Senior Member
    Join Date
    Apr 2009
    Posts
    117
    oh i figured it out!!!thanx

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center