A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: [RESOLVED] am I not referencing a clip right?

  1. #1
    Senior Member
    Join Date
    Jan 2007
    Location
    Barcelona
    Posts
    389

    resolved [RESOLVED] am I not referencing a clip right?

    Hello,

    I am trying to replicate a chat that expands the clips it is in depending on its size. I'm attaching an example I'm trying to modify to suit my needs in a chat. I have set it just like the example but my text doesn't expand even though it does trace the height of the textfield has changed.

    Can anyone see anything special or have any ideas? I can't attach my chat file here because of its size, but the only way it differs from this example is that the smiley clip is attached on runtime onto another object representing it.

    I haven't touched the code in my chat, I believe this one should work, but it expands in the example file while it doesn't in my chat.

    I don't know, i'm sure it's difficult to guess without seeing prove so I'm attaching what I believe relevant in my chat.

    this is what happens in the chat box clip.

    Code:
    _visible = false;
    function update(newval) {
    	if (newval != "" && newval != undefined && newval != null) {
    		_visible = true;
    		createText(newval);
    		startTimer();
    	} else {
    		clearInterval(displayInterval);
    		_visible = false;
    	}
    }
    function startTimer() {
    	seconds = 5;
    	clearInterval(displayInterval);
    	displayInterval = setInterval(update, 3000*seconds);
    }
    function createText(content) {
    // the format
    }
    function sizeBG() {
    	box.middle._yscale = this.dialog._height;
    	trace("box.middle._yscale = "+ box.middle._yscale);
    	trace("this.dialog._height = "+ this.dialog._height);
    	box.middle._yscale = this.dialog._height;
    	trace("box.middle._yscale = "+ box.middle._yscale);
    	trace("this.dialog._height = "+ this.dialog._height);
    	box.bottom._y = this.dialog._height;
    	this._y = _parent.character._y-30-this._height;
    }
    and the code that triggers these functions from the chat:

    Code:
    mc.box.update(msg);
    sending the message from the message input text.

  2. #2
    Senior Member
    Join Date
    Jan 2007
    Location
    Barcelona
    Posts
    389
    Hi, to whomever might follow this thread. Sorry about my poor expression. English is not my native language...

    The example works perfectly as you may have seen and I was worried about not having explained myself correctly. In my chat, this works just like in the example but it's the multiline in the text format it omits for reasons I wouldn't guess, not the expansion of the clip where it is created. It is set up the same way as the example file.

  3. #3
    Senior Member
    Join Date
    Jan 2007
    Location
    Barcelona
    Posts
    389
    Solved

    Hadn't seen these lines of code in the chat...

    Code:
    if (msg.length > 50)
    			msg = msg.substring(0,48) + "..."

  4. #4
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    971
    *Always mark your threads as Resolved, when it gets solved* It's better that way so we know which threads are solved, and which not
    Already mastering AS3. It was so fun. Now into Javascript and PHP and all its libraries

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