Adobe Flash "Definition com.greensock could not be found" hatası

TP Okuru

Megapat
Katılım
20 Aralık 2014
Mesajlar
622
Çözümler
8
Merhaba arkadaşlar
Bu uygulama çalışıyor fakat üzerinde değişikliğe gidip tekrar derleyince resimdeki hataları alıyorum. Yardımcı olabilecek var mı ?
Ödevi acil yetiştirmem gerekiyor.
Kod:
package
{
    import flash.display.Sprite;
    import flash.net.URLLoader;
    import flash.net.URLRequest;
    import flash.events.MouseEvent;
    import com.greensock.TweenNano;
    import com.greensock.easing.Elastic;
    import flash.events.Event;
    import flash.net.navigateToURL;
    import flash.display.Loader;
    import flash.media.Sound;

    public final class Main extends Sprite
    {
        private var credits:CreditsScreen;
        private var xmlLoader:URLLoader;
        private var xml:XML;
        private var nextQ:int = 0;
        private var imgLoader:Loader;
        private var sndLoader:Sound;
        private var answer:String;
        private var ca:int = 0;
        private var wa:int = 0;
    
        public final function Main():void
        {
            loadXML('q&a.xml');
            addListeners();
        }
    
        private final function loadXML(src:String):void
        {
            xmlLoader = new URLLoader(new URLRequest(src));
            xmlLoader.addEventListener(Event.COMPLETE, parseXML);
        }
    
        private final function parseXML(e:Event):void
        {
            xml = new XML(e.target.data);
        }
    
        private final function addListeners():void
        {
            menuScreen.playB.addEventListener(MouseEvent.MOUSE_UP, prepareGameScreen);
            menuScreen.creditsB.addEventListener(MouseEvent.MOUSE_UP, showCreditsScreen);
            aPanel.addEventListener(MouseEvent.MOUSE_UP, checkAnswer);
        }
    
        private final function prepareGameScreen(e:MouseEvent):void
        {
            changeQuestion();
        
            TweenNano.to(menuScreen, 0.4, {y:stage.stageHeight + (menuScreen.height * 0.5), onComplete: removeMenuScreen});
        
            /* MovieClips button mode */
        
            aPanel.button1.buttonMode = true;
            aPanel.button1.mouseChildren = false;
            aPanel.button2.buttonMode = true;
            aPanel.button2.mouseChildren = false;
            aPanel.button3.buttonMode = true;
            aPanel.button3.mouseChildren = false;
            aPanel.button4.buttonMode = true;
            aPanel.button4.mouseChildren = false;
        }
    
        private final function changeQuestion(n:int = 0):void
        {
            /* Check for last question */
        
            if(nextQ == xml.children().length())
            {
                gameOver();
            }
            else
            {
                /* Set Question and Answers */
            
                qPanel.questionTF.text = xml.children()[n];
            
                var answers:Array = [
                                        xml.children()[n].@option1,
                                        xml.children()[n].@option2,
                                        xml.children()[n].@option3,
                                        xml.children()[n].@answer
                                    ];
                var shuffledAnswers:Array = new Array(answers.length);

                var randomPos:Number = 0;
                var numberOfAnswers:int = answers.length;
                for (var i:int = 0; i < numberOfAnswers; i++)
                {
                    randomPos = int(Math.random() * answers.length);
                    shuffledAnswers[i] = answers.splice(randomPos, 1)[0];
                }
            
                aPanel.button1.oneTF.text = shuffledAnswers[0];
                aPanel.button2.twoTF.text = shuffledAnswers[1];
                aPanel.button3.threeTF.text = shuffledAnswers[2];
                aPanel.button4.fourTF.text = shuffledAnswers[3];
        
                /* Set correct answer */
            
                if (aPanel.button1.oneTF.text == xml.children()[n].@answer) answer = 'button1';
                if (aPanel.button2.twoTF.text == xml.children()[n].@answer) answer = 'button2';
                if (aPanel.button3.threeTF.text == xml.children()[n].@answer) answer = 'button3';
                if (aPanel.button4.fourTF.text == xml.children()[n].@answer) answer = 'button4';
            
                /* Move to next question */
                nextQ = n+1;
            
            
                /* Tween Panels */
        
                TweenNano.from(qPanel, 1.5, {x: -qPanel.width, ease: Elastic.easeInOut});
                TweenNano.from(aPanel, 1.5, {y: stage.stageHeight + aPanel.height, ease: Elastic.easeInOut});
            
                /* Update Question Counter */
            
                qCounterTF.text = String(nextQ) + '/' + xml.children().length();
            
                /* Check for Images */
            
                if(imgLoader != null)
                {
                    removeChild(imgLoader);
                    imgLoader = null;
                }
            
                if(xml.children()[n].@image != '')
                {
                    imgLoader = new Loader();
                    imgLoader.load(new URLRequest(xml.children()[n].@image));
                    imgLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, displayImage);
                }
            
                /* Check for Sound */
            
                if(sndLoader != null)
                {
                    sndLoader = null;
                }
            
                if(xml.children()[n].@sound != '')
                {
                    sndLoader = new Sound();
                    sndLoader.load(new URLRequest(xml.children()[n].@sound));
                    sndLoader.addEventListener(Event.COMPLETE, playSound);
                }
            }
        }
    
        private final function displayImage(e:Event):void
        {
            imgLoader.x = 360;
            imgLoader.y = -imgLoader.height;
            addChild(imgLoader);
            TweenNano.to(imgLoader, 1.5, {y:67, ease: Elastic.easeInOut});
        }
    
        private final function playSound(e:Event):void
        {
            sndLoader.play();
        }
    
        private final function removeMenuScreen():void
        {
            removeChild(menuScreen);
            menuScreen = null;
        }
    
        private final function showCreditsScreen(e:MouseEvent):void
        {
            credits = new CreditsScreen();
            credits.x = stage.stageWidth * 0.5;
            credits.addEventListener(MouseEvent.MOUSE_UP, removeCredits);
        
            addChild(credits);
            TweenNano.to(credits, 0.3, {y: stage.stageHeight * 0.5});
        }
    
        private final function removeCredits(e:MouseEvent):void
        {
            TweenNano.to(credits, 0.5, {y:-credits.height, onComplete: function():void{removeChild(credits); credits = null;}});
        }
    
        private final function checkAnswer(e:MouseEvent):void
        {
            if(answer == e.target.name)
            {
                ca++;
                changeQuestion(nextQ);
            }
            else
            {
                wa++;
                changeQuestion(nextQ);
            }
        }
    
        private final function gameOver():void
        {
            var over:GameOver = new GameOver();
        
            over.x = 15;
            over.y = 15;
            over.addEventListener(MouseEvent.MOUSE_UP, restart);
            addChild(over);
        
            over.scoreTF.text = String(Math.floor((ca / xml.children().length()) * 100)) + '%';
            over.caTF.text = String(ca);
            over.waTF.text = String(wa);
        
            TweenNano.from(over, 0.5, {x:stage.stageWidth});
        }
    
        private final function restart(e:MouseEvent):void
        {
            navigateToURL(new URLRequest(stage.loaderInfo.url), '_level0');
        }
    }
}

Basit bir text'i değiştirsem bile olmuyor.
Sanırım bu satırdaki kodlar çalışmıyor.
Kod:
    import com.greensock.TweenNano;
    import com.greensock.easing.Elastic;

123.png


Tamamdır sorunu çözdüm. Dosyayı internetten cekemiyormuş. Galiba silinmiş. Başka bir yerden indirip local açtım.
 
Uyarı! Bu konu 9 yıl önce açıldı.
Muhtemelen daha fazla tartışma gerekli değildir ki bu durumda yeni bir konu başlatmayı öneririz. Eğer yine de cevabınızın gerekli olduğunu düşünüyorsanız buna rağmen cevap verebilirsiniz.

Technopat Haberler

Geri
Yukarı