ArgumentError: Error #1063: Argument count mismatch on com.cjm::DrawLines/::onEnterFrame(). Expected 0, got 1.
This is an easy one it means that you got an argument passed to your function yet you did not specify that one was coming. So you did this “function Bob ()” instead of “function Bob (myEvent:Event)” This error is common when dealing with Events.
thanks lot you save my life
Thanks it really helped..!!!
I get this error as well, hopefully someone can help me. Here is the error.
ArgumentError: Error #1063: Argument count mismatch on Canvas/initialize(). Expected 0, got 1.
at flash.display::DisplayObjectContainer/addChild()
at LoaderMain/init()
Here is “Canvas/initialize()”
public function initialize() {
this.addEventListener(Event.ADDED_TO_STAGE, initialize);
initProjects();
initCanvas();
stage.quality=StageQuality.LOW;
}
———-
Here is LoaderMain/init()
public function init(e:Event):void {
addChild(loader.content);
tmGraphic=TweenMax.to(graphic,5,{alpha:0,delay:3,onComplete:removeGraphic});
}
———–
This isn’t my code, I am trying to mod a site for a client and having nothing but problems, as soon as I fix one error I get another. This is at least fix #30 so far.
Thanks.
Aaron Hager.
Hej Curtis,
I have made a program i AS2 and just started to migrate it to AS3. Oh boy, there are a lot of changes. I am going to buy CS5 very soon.
Searching clues on Internet I have come across your site here. I already found a lot of help using the error code and your comprehensive notes.
I am much obliged, thank you very much.
Thanks,
Ole, Denmark
Thanks! Very efficient explanation! π
[as]
var count:Number = 0;
trace(count);
function countUp(e:Event) {
count++;
trace(count);
}
setInterval(countUp, 2000);
trace(“reached_bottom”);
[/as]
——-
output panel info
——-
0
reached_bottom
ArgumentError: Error #1063: Argument count mismatch on setInterval_test_fla::MainTimeline/countUp(). Expected 1, got 0.
at Function/http://adobe.com/AS3/2006/builtin::apply()
at ()
at SetIntervalTimer/onTimer()
at flash.utils::Timer/_timerDispatch()
at flash.utils::Timer/tick()
ArgumentError: Error #1063: Argument count mismatch on setInterval_test_fla::MainTimeline/countUp(). Expected 1, got 0.
at Function/http://adobe.com/AS3/2006/builtin::apply()
at ()
at SetIntervalTimer/onTimer()
at flash.utils::Timer/_timerDispatch()
at flash.utils::Timer/tick()
——-
I’m converting a projector file from AS2 to AS3. SetInterval is giving me trouble. I’m trying to write a simple script that will iron out the functionality I need. I’m just not seeing the light here.
Thanks for the consideration .
Can you assist with this senario…
Im attempting to call the SWFLoad Function from the root… (SWFLoad is the function in the root that will preload each external SWF when its called.)
The Error Im getting is saying that the Argument expects 2 and is only getting 1. Thanks in advance!! Here is my code:
import flash.xml.*;
import flash.text.*;
import flash.events.Event;
import flash.display.Loader;
import flash.net.URLRequest;
import fl.transitions.Tween;
import fl.transitions.easing.*;
// === XML News Slider Script =====================================================================================
//Declares arrays to insert XML Data
var date_arr:Array = [];
var title_arr:Array = [];
var description_arr:Array = [];
var image_arr:Array = [];
var url_arr:Array = [];
var imageClips_arr:Array = [];
//Creates XML Loader & List
//XML Loader
var news_data:XML = new XML();
var xml_url:String = “xml/topStories.xml”;
var news_url:URLRequest = new URLRequest(xml_url);
var newsLoader:URLLoader = new URLLoader(news_url);
//Misc Needed Variables
var count:int = 0;
var activeNews:int = 0;
// Adds a listener to the loader function telling to call the function once all data is loaded
newsLoader.addEventListener(Event.COMPLETE, newsLoaded);
function newsLoaded(e:Event):void {
news_data = XML(newsLoader.data);
//XML List from data
var allNews:XMLList = news_data.*;
//Tells loader to take all the elements in the XML file and convert them to strings within the arrays.
for each (var news:XML in allNews) {
// trace(news);
date_arr.push(news.date.toString());
title_arr.push(news.title.toString());
description_arr.push(news.description.toString());
image_arr.push(news.image.toString());
url_arr.push(news.url.toString());
}
//Calls the loadImages Function
loadImages();
}
function loadImages():void {
var toLoad:int = image_arr.length;
if (count > toLoad – 1) {
var totalNews:int = title_arr.length;
var isPlaying:Boolean = true;
var timer:Timer = new Timer(15000, 0);
timer.addEventListener(TimerEvent.TIMER, timerListener);
function timerListener(e:TimerEvent) {
if (activeNews == totalNews – 1) {
//Defines Tweening of Alpha properities for image transition
var alphaTweenOut = new Tween(mc_sliderImg.mc_holder, “alpha”, None.easeNone, 0.4, 1, 1, true);
loadNews(0);
} else {
//Defines Tweening of Alpha properities for image transition
var alphaTweenOut2 = new Tween(mc_sliderImg.mc_holder, “alpha”, None.easeNone, 0.4, 1, 1, true);
loadNews(activeNews + 1);
}
}
timer.reset();
timer.start();
function loadNews(num:int):void {
activeNews = num;
mc_sliderImg.btn_gotoStory.enabled = false;
mc_sliderImg.mc_holder.addChild(imageClips_arr[num]);
mc_sliderText.txt_date.text = date_arr[num];
mc_sliderText.txt_title.text = title_arr[num];
mc_sliderText.txt_desc.text = description_arr[num];
mc_sliderImg.btn_gotoStory.enabled = true;
mc_sliderImg.btn_gotoStory.addEventListener(MouseEvent.CLICK, redirect);
function redirect(e:MouseEvent):void {
var url_request:URLRequest = new URLRequest(url_arr[num]);
(root.loaderInfo.loader.root as Object).SWFLoad(url_request, mc_content);
}
}
// Loads First Story
loadNews(0);
} else {
//Preloads Images from the images array into empty movie clips
var mc:MovieClip = new MovieClip;
imageClips_arr.push(mc);
var img_url:String = “images/” + image_arr[count];
var loader:Loader = new Loader();
var request_url:URLRequest = new URLRequest(img_url);
loader.load(request_url);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeListener);
function completeListener(e:Event):void {
mc.addChild(loader.content);
}
count++;
loadImages();
}
}
de nada Paul.
muchas gracias, Curtis !
Ryeanne,
It sounds like you have 1 to many arguments . Your Flex Function is getting 6 & it only wants 5.
If you need more help please put the errant code in your next comment.
Thanks,
Curtis J. Morley
help me with this error:
ArgumentError: Error #1063: Argument count mismatch on mx.core::CrossDomainRSLItem(). Expected 5, got 6.
at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::initialize()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\managers\SystemManager.as:1825]
at mx.managers::SystemManager/initHandler()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\managers\SystemManager.as:2904]
This helped. Thanks much!!!!
Tetsu.
γ©γγγγγΎγγ¦. Let me know what else I can do for you.
Thanks,
Curtis J. Morley
This just helped solve a coding problem that I’ve been working on for 2 hours. Thanks so much, Mr.Morley!!
Yark, Jeff, Bas, and j,
Glad this helped. Events can sometimes be tricky.
Thanks,
Curtis J. Morley
thanks!
This was just what I needed, thanks!
Thanks! This helped.
Thank you so much for this.
I’m just learning AS3, and found a few other similar pages which did not answer the question. then I stumbled over here…
I appreciate the straightforward approach!